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

@ -1,5 +1,4 @@
using Cirno.Scripts.Components.Actors._3D;
using Cirno.Scripts.Components.FSM.Player;
using Cirno.Scripts.Utils;
using Godot;
@ -11,11 +10,13 @@ public partial class Cutscene : BaseState<PlayerState, CharacterBody3D>
[Export] public PlayerAnimationProvider3D AnimationProvider { get; set; }
[Export] public IsoPlayerStorageModule PlayerStorage { get; private set; }
private IsoPlayerStorageModule PlayerStorage { get; set; }
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
{
base.Init(machine);
if (machine is IsoPlayerStateMachine sm)
PlayerStorage = sm.Storage;
}
public override void EnterState()
@ -40,15 +41,4 @@ public partial class Cutscene : BaseState<PlayerState, CharacterBody3D>
AnimationProvider.SetAnimation(MainObject.Velocity.ToVector2());
}
public override void PhysicsProcessState(double delta)
{
// Reset at start of frame
//MainObject.Velocity = Vector2.Zero;
// Process modules
base.PhysicsProcessState(delta);
}
}