38 lines
1.2 KiB
C++
Executable file
38 lines
1.2 KiB
C++
Executable file
#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<FLifetimeProperty>& OutLifetimeProps) const override;
|
|
|
|
protected:
|
|
UFUNCTION(BlueprintCallable)
|
|
void OnResourceChanged(UCappedResource* CappedResource, float Amount);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void OnRep_GemsCollected(int32 prevAmount);
|
|
|
|
};
|
|
|