|
Night Sky Engine
A fighting game framework made in Unreal Engine
|
The player object's state machine. More...
#include <StateMachine.h>
Public Member Functions | |
| void | AddState (const FGameplayTag &Name, UState *Config) |
| FORCEINLINE bool | IsCurrentState (const FGameplayTag &Name) const |
| FGameplayTag | GetStateName (int Index) |
| int | GetStateIndex (FGameplayTag Name) const |
| bool | SetState (const FGameplayTag Name, bool bIsAlias=false) |
| bool | ForceSetState (const FGameplayTag Name, bool bIsAlias=false) |
| bool | ForceSetState (TSubclassOf< UState > Class, bool bIsAlias=false) |
| bool | ForceRollbackState (const FGameplayTag Name) |
| void | Update () const |
Static Public Member Functions | |
| static bool | CheckStateStanceCondition (const EEntryStance StateStance, const int PlayerStance) |
Public Attributes | |
| bool | bPrimary |
| FGameplayTag | StateMachineName |
| int32 | EnableFlags = 0 |
| TArray< FGameplayTag > | EnabledCustomStateTypes |
| UState * | CurrentState |
| TArray< UState * > | States |
| TArray< FGameplayTag > | StateNames |
| APlayerObject * | Parent |
The player object's state machine.
Contains all player states and state names, as well as the currently active state.
Definition at line 18 of file StateMachine.h.
| void FStateMachine::AddState | ( | const FGameplayTag & | Name, |
| UState * | Config ) |
Adds a state to the state machine. If no current state is set, the input state will be used as the current state. Only call at the beginning of a match!
Definition at line 9 of file StateMachine.cpp.
|
static |
Checks if the state allows the player's current stance.
| StateStance | The state's required stance. |
| PlayerStance | The current player's stance. |
Definition at line 154 of file StateMachine.cpp.
| bool FStateMachine::ForceRollbackState | ( | const FGameplayTag | Name | ) |
Sets the current state for rollback. Code called when entering a state normally will not be called.
| Name | The state to set as current. |
Definition at line 142 of file StateMachine.cpp.
| bool FStateMachine::ForceSetState | ( | const FGameplayTag | Name, |
| bool | bIsAlias = false ) |
Sets the current state. If the state to set is the same as the current state, the state will be reset.
| Name | The state to set as current. |
| bIsAlias | If the state is being set via an alias. |
Definition at line 75 of file StateMachine.cpp.
| bool FStateMachine::ForceSetState | ( | TSubclassOf< UState > | Class, |
| bool | bIsAlias = false ) |
Sets the current state. If the state to set is the same as the current state, the state will be reset.
| Class | The state to set as current. |
| bIsAlias | If the state is being set via an alias. |
Definition at line 108 of file StateMachine.cpp.
| int FStateMachine::GetStateIndex | ( | FGameplayTag | Name | ) | const |
Gets the current state index.
Definition at line 31 of file StateMachine.cpp.
| FGameplayTag FStateMachine::GetStateName | ( | int | Index | ) |
Gets the current state name.
Definition at line 22 of file StateMachine.cpp.
|
inline |
Checks a name against the current state name.
Definition at line 72 of file StateMachine.h.
| bool FStateMachine::SetState | ( | const FGameplayTag | Name, |
| bool | bIsAlias = false ) |
Sets the current state. If attempting to set the state to the same as the current state, nothing will happen.
| Name | The state to set as current. |
| bIsAlias | If the state is being set via an alias. |
Definition at line 36 of file StateMachine.cpp.
| void FStateMachine::Update | ( | ) | const |
Calls the current state's exec function.
Definition at line 168 of file StateMachine.cpp.
| bool FStateMachine::bPrimary |
Definition at line 24 of file StateMachine.h.
| UState* FStateMachine::CurrentState |
The currently active state.
Definition at line 44 of file StateMachine.h.
| TArray<FGameplayTag> FStateMachine::EnabledCustomStateTypes |
Currently enabled custom state types.
Definition at line 39 of file StateMachine.h.
| int32 FStateMachine::EnableFlags = 0 |
Flags of currently enabled states.
Definition at line 34 of file StateMachine.h.
| APlayerObject* FStateMachine::Parent |
The parent of this state machine.
Definition at line 60 of file StateMachine.h.
| FGameplayTag FStateMachine::StateMachineName |
The currently active state.
Definition at line 29 of file StateMachine.h.
| TArray<FGameplayTag> FStateMachine::StateNames |
An array of all player state names. Used to lookup states.
Definition at line 55 of file StateMachine.h.
| TArray<UState*> FStateMachine::States |
An array of all player states.
Definition at line 49 of file StateMachine.h.