LEAP Documentation 40220
Documentation for the LEAP project
ObjectiveRandomizer.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"
6#include "GameFramework/Actor.h"
8#include "ProjectXGameMode.h"
9#include "WeakInterfacePtr.h"
10#include "SpawnInterface.h"
11#include "ObjectiveRandomizer.generated.h"
12
14
15UCLASS()
16class PROJECTX_API AObjectiveRandomizer : public AActor, public IReactsToMatchEvents, public ISpawnInterface
17{
18 GENERATED_UCLASS_BODY()
19
20public:
21 virtual void BeginSpawning_Implementation() override;
22 virtual void StopSpawning_Implementation() override;
23
24 virtual AProjectXSpawnerObjective* GetObjective() override;
25 virtual bool IsAnObjective() const override { return true; }
26
27 virtual FSpawnProgressSignature& GetSpawnCompleteEvent() override { return OnObjectiveSpawnedEvent; }
28 virtual FSpawnEventCompleteSignature& GetEventCompleteEvent() override { return OnObjectiveCompletedEvent; }
29
30 UPROPERTY(BlueprintAssignable)
31 FSpawnEventCompleteSignature OnObjectiveCompletedEvent;
32 UPROPERTY(BlueprintAssignable)
33 FSpawnProgressSignature OnObjectiveSpawnedEvent;
34
35protected:
36 virtual void SetRandomObjetive();
37
38 UFUNCTION()
39 virtual void OnObjectiveCompleted(bool bSuccess);
40 UFUNCTION()
41 virtual void OnObjectiveSpawned(UObject* Spawner);
42
43 /* List of objectives to select a random one from*/
44 UPROPERTY(BlueprintReadWrite,EditAnywhere)
45 TArray<AProjectXSpawnerObjective*> ObjectiveList = TArray<AProjectXSpawnerObjective*>();
46
47 TWeakObjectPtr<AProjectXSpawnerObjective> SelectedObjective = nullptr;
48};
Definition: ObjectiveRandomizer.h:17
virtual FSpawnEventCompleteSignature & GetEventCompleteEvent() override
Definition: ObjectiveRandomizer.h:28
virtual bool IsAnObjective() const override
Definition: ObjectiveRandomizer.h:25
virtual FSpawnProgressSignature & GetSpawnCompleteEvent() override
Definition: ObjectiveRandomizer.h:27
Definition: ProjectXSpawnerObjective.h:53
virtual void StopSpawning_Implementation() override
Definition: ProjectXSpawnerObjective.cpp:108
FSpawnEventCompleteSignature OnObjectiveCompletedEvent
Definition: ProjectXSpawnerObjective.h:82
FSpawnProgressSignature OnObjectiveSpawnedEvent
Definition: ProjectXSpawnerObjective.h:84
virtual AProjectXSpawnerObjective * GetObjective() override
Definition: ProjectXSpawnerObjective.h:65
virtual void BeginSpawning_Implementation() override
Definition: ProjectXSpawnerObjective.cpp:86
Definition: ReactsToMatchEvents.h:16
Definition: SpawnInterface.h:24