using Godot; namespace Cirno.Scripts.Components.FSM; public abstract partial class ModuleBase : Node, IModule where TKey : notnull where TType : Node { // Provide the state machine reference for derived modules to use without repeating boilerplate protected IStateMachine 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 machine) { StateMachine = machine; } public abstract void EnterState(TKey state); public abstract void ExitState(TKey state); public abstract void Process(double delta); public abstract void PhysicsProcess(double delta); }