diff --git a/Source/vampires/EXPComponent.cpp b/Source/vampires/EXPComponent.cpp index 670f703..d43bd5f 100644 --- a/Source/vampires/EXPComponent.cpp +++ b/Source/vampires/EXPComponent.cpp @@ -17,14 +17,15 @@ void UEXPComponent::IncrementEXP(int value) { // TODO: I should be updating the level here CurrentEXP += value; - OnEXPGained.ExecuteIfBound(); + OnEXPGained.ExecuteIfBound(value); + OnEXPLevelUp.ExecuteIfBound(CurrentLevel); } void UEXPComponent::SetCurrentEXP(int value) { // TODO: I should be updating the level here CurrentEXP = value; - OnEXPGained.ExecuteIfBound(); + OnEXPGained.ExecuteIfBound(value); } int UEXPComponent::GetCurrentEXP() @@ -41,6 +42,8 @@ void UEXPComponent::Reset() { CurrentEXP = 0; CurrentLevel = 0; + OnEXPGained.ExecuteIfBound(CurrentEXP); + OnEXPLevelUp.ExecuteIfBound(CurrentLevel); } // Called when the game starts diff --git a/Source/vampires/EXPComponent.h b/Source/vampires/EXPComponent.h index 021c89e..a593516 100644 --- a/Source/vampires/EXPComponent.h +++ b/Source/vampires/EXPComponent.h @@ -6,8 +6,8 @@ #include "Components/ActorComponent.h" #include "EXPComponent.generated.h" -DECLARE_DELEGATE(FOnEXPGainedDelegate) -DECLARE_DELEGATE(FOnEXPLevelUpDelegate) +DECLARE_DELEGATE_OneParam(FOnEXPGainedDelegate, int) +DECLARE_DELEGATE_OneParam(FOnEXPLevelUpDelegate, int) UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) class VAMPIRES_API UEXPComponent : public UActorComponent