From 44e0a6bc2d1943d05bb4296ceb6e2c3a68b29742 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Wed, 27 Sep 2023 14:47:50 +0100 Subject: [PATCH] Implemented Checkpoint Class Functionality --- .../BountySystem/CheckpointClass.h | 54 +++++++++++++++++-- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h index d8e09c23..c182b8cb 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h @@ -6,21 +6,65 @@ #include "GameFramework/Actor.h" #include "CheckpointClass.generated.h" +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedCheckpoint); + UCLASS() class ENDLESSVENDETTA_API ACheckpointClass : public AActor { GENERATED_BODY() + + // ------ Properties set from Editor ------ + UPROPERTY(EditDefaultsOnly, Category = "Checkpoint") + FString CheckpointDescription; + UPROPERTY(EditDefaultsOnly, Category = "Checkpoint") + FVector WaypointLoc; + UPROPERTY(EditDefaultsOnly, Category = "Checkpoint") + UTexture2D* WaypointIcon; + UPROPERTY(EditDefaultsOnly, Category = "Checkpoint") + FTransform CheckpointSpawnTransform; + // ---------------------------------------- -public: - // Sets default values for this actor's properties - ACheckpointClass(); + UFUNCTION(BlueprintCallable, Category = "Checkpoint") + void BroadcastCompletion() + { + CompletedCheckpoint.Broadcast(); + } protected: // Called when the game starts or when spawned virtual void BeginPlay() override; + +public: + FCompletedCheckpoint CompletedCheckpoint; -public: + UPROPERTY(BlueprintReadOnly, Category = "Checkpoint") + bool Active = false; + + // ------ Getters for CP Properties ------ + FString GetCheckpointDesc() + { + return CheckpointDescription; + } + FVector GetWaypointLoc() + { + return WaypointLoc; + } + UTexture2D* GetWaypointIcon() + { + return WaypointIcon; + } + FTransform GetCheckpointSpawnTransform() + { + return CheckpointSpawnTransform; + } + // --------------------------------------- + + // Sets default values for this actor's properties + ACheckpointClass(); + // Called every frame - virtual void Tick(float DeltaTime) override; + virtual void Tick(float DeltaTime) override; + + };