Files
Infratest/Assets/Code/Infrastructure/StateMachine/BaseState.cs
T
ThomasCharester 5f5ace1b52 Essentials + extra crap
Loadings
Startups
Movement
Camera
2026-01-12 18:43:51 +03:00

37 lines
908 B
C#

namespace Code.Infrastructure.StateMachine
{
public abstract class BaseState<TEnum, TStateMachineContext>
{
public abstract TEnum myState { get; }
protected BaseState(TStateMachineContext context, EventBus.EventBus eventBus)
{
Context = context;
EventBus = eventBus;
}
protected EventBus.EventBus EventBus;
protected TStateMachineContext Context { get; }
protected virtual void _fireEnterState()
{
}
protected virtual void _fireExitState()
{
}
protected abstract void OnEnterState();
protected abstract void OnExitState();
public void EnterState()
{
OnEnterState();
_fireEnterState();
}
public void ExitState()
{
OnExitState();
_fireExitState();
}
}
}