feat: add state machine

This commit is contained in:
Bragin Stepan
2026-03-02 19:00:06 +05:00
parent 99c88c071f
commit 7737ee3158
50 changed files with 828 additions and 128 deletions

View File

@@ -0,0 +1,32 @@
using System.Collections.Generic;
namespace Assets._Project.Develop.Runtime.Utilities.StateMachineCore
{
public abstract class ParallelState<TState> : State where TState : class, IState
{
private List<TState> _states;
public ParallelState(params TState[] states)
{
_states = new List<TState>(states);
}
protected IReadOnlyList<TState> States => _states;
public override void Enter()
{
base.Enter();
foreach (TState state in _states)
state.Enter();
}
public override void Exit()
{
base.Exit();
foreach (TState state in _states)
state.Exit();
}
}
}