mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-06 20:45:53 +00:00
Migrated player state machine
This commit is contained in:
parent
bb3cdefaa2
commit
9c3f22760b
19 changed files with 108 additions and 69 deletions
18
Scripts/Components/FSM/PlayerArea2DModule.cs
Normal file
18
Scripts/Components/FSM/PlayerArea2DModule.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM;
|
||||
|
||||
public abstract partial class PlayerArea2DModule : Area2D, IModule<PlayerState, CharacterBody2D>
|
||||
{
|
||||
public IStateMachine<PlayerState, CharacterBody2D> StateMachine { get; private set; }
|
||||
|
||||
public CharacterBody2D CharacterBody => StateMachine.MainObject;
|
||||
|
||||
|
||||
public virtual void Init(IStateMachine<PlayerState, CharacterBody2D> machine)
|
||||
{
|
||||
StateMachine = machine;
|
||||
}
|
||||
public abstract void Process(double delta);
|
||||
public abstract void PhysicsProcess(double delta);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue