LEAP Documentation 40220
Documentation for the LEAP project
ProjectXObjectiveCapturePoint.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2022. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "ProjectXObjectiveCapturePoint.generated.h"
8
10
11USTRUCT(BlueprintType)
13{
14 GENERATED_USTRUCT_BODY()
15
17public:
18 UPROPERTY(BlueprintReadWrite,EditAnywhere)
19 uint8 NumberOfPointsToActivate = 1;
20};
21
22USTRUCT(BlueprintType)
24{
25 GENERATED_USTRUCT_BODY()
27public:
28 UPROPERTY()
29 TArray<TWeakObjectPtr<AObjectiveCapturePoint>> CapturePoints = TArray<TWeakObjectPtr<AObjectiveCapturePoint>>();
30};
31
32DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCapturePointObjectivePhaseUpdatedSignature, uint8, PhaseNumber);
33DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCapturePointsUpdatedSignature, const TArray<AObjectiveCapturePoint*>&, CapturePoints);
34
35UCLASS()
37{
38 GENERATED_UCLASS_BODY()
39public:
40 UFUNCTION(BlueprintCallable)
41 uint8 GetPhaseNumber() const {return CurrentCapturePhase;}
42 UFUNCTION(BlueprintCallable)
43 int32 GetNumberOfCheckPoints() const { return NumberOfCapturePointCheckpoints; }
44 UFUNCTION(BlueprintCallable)
45 float GetPlayerCaptureRate() const;
46 UFUNCTION(BlueprintCallable)
47 bool GetCapturePoints(uint8 PhaseNumber,TArray<AObjectiveCapturePoint*>& FoundCapturePoints) const;
48 UFUNCTION(BlueprintCallable)
49 void GetAllCapturePoints(TArray<AObjectiveCapturePoint*>& FoundCapturePoints) const;
50
51 virtual bool IsObjectiveComplete() const override;
52 virtual bool IsCapturePhaseComplete() const;
53
54 UPROPERTY(BlueprintAssignable)
55 FOnCapturePointObjectivePhaseUpdatedSignature OnPhaseNumberUpdatedEvent;
56 UPROPERTY(BlueprintAssignable)
57 FOnCapturePointsUpdatedSignature OnCapturePointsUpdatedEvent;
58
59protected:
60 virtual void BeginPlay() override;
61 virtual void InitializeGamePlayObjects() override;
62 virtual void ObjectiveStarted() override;
63 virtual void ObjectiveComplete() override;
64 virtual void UpdateCapturePointPhase();
65 virtual void StartCurrentCapturePhase();
66 virtual void EndCurrentCapturePhase();
67
68 UFUNCTION()
69 virtual void OnObjectiveActorSpawned(AActor* SpawnedActor);
70 UFUNCTION()
71 virtual void OnCapturePointClaimed(int32 TeamOwner, ACapturePoint* Point);
72 UFUNCTION()
73 virtual void OnRep_PhaseNumber();
74 UFUNCTION()
75 virtual void OnRep_ChosenCapturePoints();
76
77 /* INformation for each phase of capture points*/
78 UPROPERTY(EditAnywhere)
79 TArray<FCapturePointPhaseInfo> PhaseInfo;
80 /*potential capture points to use*/
81 UPROPERTY(EditAnywhere)
82 TArray<AObjectiveCapturePoint*> AvailableCapturePoints;
83
84 /* Delay between capture points activation*/
85 UPROPERTY(EditAnywhere)
86 float CapturePointActivationDelay = 0.0f;
87 /*Number of exp trigger points*/
88 UPROPERTY(EditAnywhere)
89 uint8 NumberOfCapturePointCheckpoints = 3;
90 /* per player capture rate*/
91 UPROPERTY(EditAnywhere)
93 /* are points destroyed when the objective is complete*/
94 UPROPERTY(EditAnywhere)
95 bool bDestroyPointsOnComplete = false;
96
97private:
98 FTimerHandle PhaseDelayTimer;
99 UPROPERTY(ReplicatedUsing = OnRep_PhaseNumber)
100 uint8 CurrentCapturePhase = -1;
101 UPROPERTY(ReplicatedUsing = OnRep_ChosenCapturePoints)
102 TArray<FCapturePointActivePhaseInfo> ChosenCapturePoints = TArray<FCapturePointActivePhaseInfo>();
103};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCapturePointObjectivePhaseUpdatedSignature, uint8, PhaseNumber)
Definition: CapturePoint.h:77
virtual void BeginPlay() override
Definition: CapturePoint.cpp:41
float PerPlayerCaptureRate
Definition: CapturePoint.h:291
int32 TeamOwner
Definition: CapturePoint.h:275
Definition: ObjectiveCapturePoint.h:16
Definition: ProjectXObjectiveCapturePoint.h:37
Definition: ProjectXSpawnerObjective.h:53
Definition: ProjectXObjectiveCapturePoint.h:24
Definition: ProjectXObjectiveCapturePoint.h:13