Add FSM components for player and enemy state management, including initialization and module resolution

This commit is contained in:
MaddoScientisto 2026-02-26 23:13:57 +01:00
commit b6cc5a00e8
57 changed files with 526 additions and 506 deletions

View file

@ -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);
}