vampires/Source/vampires/GoldComponent.h

42 lines
773 B
C
Raw Normal View History

2025-02-05 23:12:03 +00:00
// Louis Hobbs | 2024-2025
2024-06-19 16:55:26 +01:00
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "GoldComponent.generated.h"
2025-02-08 15:36:29 +00:00
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnGoldGainedDelegate, int, gold);
2024-06-19 16:55:26 +01:00
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class VAMPIRES_API UGoldComponent : public UActorComponent
{
GENERATED_BODY()
public:
FOnGoldGainedDelegate OnGoldGained;
protected:
int CurrentGold = 0;
public:
// Sets default values for this component's properties
UGoldComponent();
UFUNCTION()
void IncrementGold(int value);
UFUNCTION()
void SetCurrentGold(int value);
UFUNCTION()
int GetCurrentGold();
UFUNCTION()
void Reset();
protected:
// Called when the game starts
virtual void BeginPlay() override;
};