Implemented Side Bounty Class Functionality

This commit is contained in:
Rafal Swierczek 2023-09-27 18:52:35 +01:00
parent 52af66afec
commit 5e6f5e4b9e
4 changed files with 55 additions and 7 deletions

View File

@ -3,3 +3,33 @@
#include "SideBountyClass.h"
void ASideBountyClass::BeginPlay()
{
Super::BeginPlay();
MinCPsRequiredForCompletion = 1;
}
void ASideBountyClass::IncrementBountyCheckpoint()
{
Super::IncrementBountyCheckpoint();
if (Completed)
{
CompletedSideBounty.Broadcast(ActiveSBC_Index);
}
}
void ASideBountyClass::DestroyCheckpoints()
{
for (int i = 0; i < BountyCheckpoints.Num(); i++)
{
if (BountyCheckpoints[i] == nullptr)
{
continue;
}
BountyCheckpoints[i]->Destroy();
}
}

View File

@ -6,12 +6,30 @@
#include "BountyClass.h"
#include "SideBountyClass.generated.h"
/**
*
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCompletedSideBounty, int, SB_Index);
UCLASS()
class ENDLESSVENDETTA_API ASideBountyClass : public ABountyClass
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly, Category = "Side Bounty")
TMap<int, TSubclassOf<ACheckpointClass>> ReplacementCheckpoints;
protected:
virtual void BeginPlay() override;
public:
FCompletedSideBounty CompletedSideBounty;
int ActiveSBC_Index;
TMap<int, TSubclassOf<ACheckpointClass>> GetReplacementCheckpoints()
{
return ReplacementCheckpoints;
}
virtual void IncrementBountyCheckpoint() override;
void DestroyCheckpoints();
};