mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Add FSM components for player and enemy state management, including initialization and module resolution
This commit is contained in:
parent
18683c0680
commit
b6cc5a00e8
57 changed files with 526 additions and 506 deletions
|
|
@ -6,9 +6,18 @@ public abstract partial class ModuleBase<TKey, TType> : Node, IModule<TKey, TTyp
|
|||
where TKey : notnull
|
||||
where TType : Node
|
||||
{
|
||||
// Provide the state machine reference for derived modules to use without repeating boilerplate
|
||||
protected IStateMachine<TKey, TType> StateMachine { get; private set; }
|
||||
protected TType MainObject => StateMachine.MainObject;
|
||||
|
||||
// Default Init behaviour sets the state machine reference. Derived classes can still override
|
||||
public virtual void Init(IStateMachine<TKey, TType> machine)
|
||||
{
|
||||
StateMachine = machine;
|
||||
}
|
||||
|
||||
public abstract void EnterState(TKey state);
|
||||
public abstract void ExitState(TKey state);
|
||||
public abstract void Init(IStateMachine<TKey, TType> machine);
|
||||
public abstract void Process(double delta);
|
||||
public abstract void PhysicsProcess(double delta);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue