-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJxxStateTreeSomethingBlueprintBase.h
More file actions
125 lines (85 loc) · 3.58 KB
/
JxxStateTreeSomethingBlueprintBase.h
File metadata and controls
125 lines (85 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/StateTreeConditionBlueprintBase.h"
#include "Blueprint/StateTreeEvaluatorBlueprintBase.h"
#include "Blueprint/StateTreeTaskBlueprintBase.h"
#include "JxxStateTreeSomethingBlueprintBase.generated.h"
USTRUCT(BlueprintType)
struct JXXAI_API FBPStateTreeStateInfo
{
GENERATED_BODY()
FBPStateTreeStateInfo() = default;
FBPStateTreeStateInfo(const FCompactStateTreeState& InState)
{
Name = InState.Name;
LinkedState = InState.LinkedState;
LinkedAsset = InState.LinkedAsset;
Parent = InState.Parent;
Type = InState.Type;
SelectionBehavior = InState.SelectionBehavior;
bHasTransitionTasks = InState.bHasTransitionTasks;
bEnabled = InState.bEnabled;
}
/** Name of the State */
UPROPERTY(BlueprintReadOnly)
FName Name = NAME_None;
/** Linked state handle if the state type is linked state. */
UPROPERTY(BlueprintReadOnly)
FStateTreeStateHandle LinkedState = FStateTreeStateHandle::Invalid;
UPROPERTY(BlueprintReadOnly)
TObjectPtr<UStateTree> LinkedAsset = nullptr;
/** Parent state handle, invalid if root state. */
UPROPERTY(BlueprintReadOnly)
FStateTreeStateHandle Parent = FStateTreeStateHandle::Invalid;
/** Type of the state */
UPROPERTY(BlueprintReadOnly)
EStateTreeStateType Type = EStateTreeStateType::State;
/** What to do when the state is considered for selection. */
UPROPERTY(BlueprintReadOnly)
EStateTreeStateSelectionBehavior SelectionBehavior = EStateTreeStateSelectionBehavior::TrySelectChildrenInOrder;
/** True if the state contains tasks that should be called during transition handling. */
UPROPERTY(BlueprintReadOnly)
bool bHasTransitionTasks = false;
/** True if the state is Enabled (i.e. not explicitly marked as disabled). */
UPROPERTY(BlueprintReadOnly)
bool bEnabled = false;
};
UCLASS(Abstract)
class JXXAI_API UJxxStateTreeTaskBlueprintBase : public UStateTreeTaskBlueprintBase
{
GENERATED_BODY()
protected:
virtual EStateTreeRunStatus EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition)override;
virtual EStateTreeRunStatus Tick(FStateTreeExecutionContext& Context, const float DeltaTime) override;
virtual void ExitState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition)override;
UFUNCTION(BlueprintCallable, meta = (ExpandBoolAsExecs = "ReturnValue"))
bool GetStateInfo_Exec(FStateTreeStateHandle InState, FBPStateTreeStateInfo& OutStateInfo)const;
UFUNCTION(BlueprintCallable)
FBPStateTreeStateInfo GetStateInfo(FStateTreeStateHandle InState)const;
UPROPERTY(BlueprintReadOnly)
TWeakObjectPtr<AActor> ContextActor;
UPROPERTY(BlueprintReadOnly)
TArray<FStateTreeEvent> EventToProcess;
UPROPERTY(BlueprintReadOnly)
const UStateTree* StateTreeAsset;
};
UCLASS(Abstract)
class JXXAI_API UJxxStateTreeEvaluatorBlueprintBase : public UStateTreeEvaluatorBlueprintBase
{
GENERATED_BODY()
protected:
virtual void TreeStart(FStateTreeExecutionContext& Context) override;
virtual void TreeStop(FStateTreeExecutionContext& Context) override;
UPROPERTY(BlueprintReadOnly)
TWeakObjectPtr<AActor> ContextActor;
};
UCLASS(Abstract)
class JXXAI_API UJxxStateTreeConditionBlueprintBase : public UStateTreeConditionBlueprintBase
{
GENERATED_BODY()
protected:
virtual bool TestCondition(FStateTreeExecutionContext& Context) const override;
UPROPERTY(BlueprintReadOnly)
mutable TWeakObjectPtr<AActor> ContextActor;
};