cirnogodot/Scripts/Components/FSM/IStateMachine.cs

18 lines
522 B
C#
Raw Normal View History

2025-03-04 17:50:16 +01:00
using System.Collections.Generic;
using Godot;
namespace Cirno.Scripts.Components.FSM;
2025-03-04 18:16:39 +01:00
public interface IStateMachine<TKey, [MustBeVariant] TType>
2025-03-04 17:50:16 +01:00
where TKey : notnull
where TType : Node
{
public Dictionary<TKey, IState<TKey, TType>> States { get; set; }
protected TKey CurrentStateIndex { get; set; }
public IState<TKey, TType> CurrentState { get; }
public TKey InitialState { get; }
public void SetState(TKey stateId);
2025-06-26 14:03:36 +02:00
public TKey GetState();
2025-03-04 17:50:16 +01:00
public TType MainObject { get; }
}