DRG-Femboy-Voice/Source/FSD/Public/GatheItemsObjective.h
2025-04-15 12:39:31 -07:00

38 lines
1.2 KiB
C++
Executable file

#pragma once
#include "CoreMinimal.h"
#include "ResourceBasedObjective.h"
#include "GatheItemsObjective.generated.h"
class UCappedResource;
class UCollectableResourceData;
UCLASS(Abstract, Blueprintable, ClassGroup=Custom, meta=(BlueprintSpawnableComponent))
class UGatheItemsObjective : public UResourceBasedObjective {
GENERATED_BODY()
public:
protected:
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
int32 ItemsRequired;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
float ItemsSpawnedModifier;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, ReplicatedUsing=OnRep_ItemsCollected, meta=(AllowPrivateAccess=true))
int32 ItemsCollected;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
UCollectableResourceData* ItemResource;
public:
UGatheItemsObjective();
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
protected:
UFUNCTION(BlueprintCallable)
void OnResourceChanged(UCappedResource* CappedResource, float Amount);
UFUNCTION(BlueprintCallable)
void OnRep_ItemsCollected(int32 prevAmount);
};