mirror of
https://github.com/Bragin-Stepan/project-entity.git
synced 2026-03-02 14:29:23 +00:00
21 lines
568 B
C#
21 lines
568 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Assets._Project.Develop.Runtime.Utilities.StateMachineCore
|
|
{
|
|
public class StateNode<TState> where TState : class, IState
|
|
{
|
|
private List<StateTransition<TState>> _transitions = new();
|
|
|
|
public StateNode(TState state)
|
|
{
|
|
State = state;
|
|
}
|
|
|
|
public TState State { get; }
|
|
|
|
public IReadOnlyList<StateTransition<TState>> Transitions => _transitions;
|
|
|
|
public void AddTransition(StateTransition<TState> transition) => _transitions.Add(transition);
|
|
}
|
|
}
|