#pragma once #include "CoreMinimal.h" #include "ResourceBasedObjective.h" #include "GatherGemsObjective.generated.h" class UCappedResource; class UGemResourceData; UCLASS(Abstract, Blueprintable, ClassGroup=Custom, meta=(BlueprintSpawnableComponent)) class FSD_API UGatherGemsObjective : public UResourceBasedObjective { GENERATED_BODY() public: protected: UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) int32 GemsRequired; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) float GemsSpawnedModifier; UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, ReplicatedUsing=OnRep_GemsCollected, meta=(AllowPrivateAccess=true)) int32 GemsCollected; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) UGemResourceData* GemResource; public: UGatherGemsObjective(); virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; protected: UFUNCTION(BlueprintCallable) void OnResourceChanged(UCappedResource* CappedResource, float Amount); UFUNCTION(BlueprintCallable) void OnRep_GemsCollected(int32 prevAmount); };