LEAP Documentation 40220
Documentation for the LEAP project
ManagedStateActor.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
7#include "ManagedStateActor.generated.h"
8
9class AController;
10
11UENUM(BlueprintType)
12enum class EManagedActorState : uint8
13{
14 Off = 0,
15 On = 1,
16 Damaged = 2
17};
18
19UCLASS()
20class PROJECTX_API AManagedStateActor : public AActor
21{
22 GENERATED_BODY()
23
24private:
25 uint8 State = 0;
26 uint8 LastState = 0;
27
28protected:
29 friend class AActorStateManager;
30
32
33public:
34 UFUNCTION(BlueprintCallable, Category = "State Functions")
35 virtual void SetState(AController* Sender, const uint8 NewState, bool bIsFromInit = false);
36 UFUNCTION(BlueprintCallable, Category = "State Functions")
37 void RequestStateChange(AController* Sender, const uint8 NewState);
38 UFUNCTION(BlueprintPure, Category = "State Functions")
39 virtual uint8 GetStateCount() const;
40 UFUNCTION(BlueprintPure, Category = "State Functions")
41 virtual uint8 GetState() const;
42 UFUNCTION(BlueprintPure, Category = "State Functions")
43 virtual uint8 GetLastState() const;
44 UFUNCTION(BlueprintPure, Category = "State Functions")
45 virtual uint8 GetAutoIncrementState() const;
46
47 UFUNCTION(BlueprintImplementableEvent, Category = "State Events")
48 void OnStateChanged(bool bIsFromInit);
49};
EManagedActorState
Definition: ManagedStateActor.h:13
Definition: ActorStateManager.h:14
void SetState(AController *Sender, AManagedStateActor *Actor, const uint8 State)
Definition: ActorStateManager.cpp:42
Definition: ManagedStateActor.h:21