perf: regular events to custom events

This commit is contained in:
2025-05-30 12:58:08 +03:00
parent b1b5af94d3
commit 846aa75dd5
42 changed files with 342 additions and 198 deletions

View File

@@ -10,7 +10,7 @@ public class State : BaseEntity, IState
public event IState.StateTransitionedFromEventHandler? OnStateTransitionedFrom = null;
public event IState.StateTransitionedToEventHandler? OnStateTransitionedTo = null;
public event IState.StateTransitionReadyEventHandler? OnStateTransitionReady = null;
public event INameable.NameChangedEventHandler? OnNameChanged = null;
public Event<INameable, string> OnNameChanged { get; private set; } = new();
private readonly List<StateTransition> transitions = [];
private readonly Dictionary<string, StateTransition> possibleTransitions = [];

View File

@@ -7,7 +7,8 @@ public abstract class StateBehaviourBase : Behaviour, IState
public event IState.StateUpdateEventHandler? OnStateUpdate = null;
public event IState.StateTransitionedFromEventHandler? OnStateTransitionedFrom = null;
public event IState.StateTransitionedToEventHandler? OnStateTransitionedTo = null;
public event INameable.NameChangedEventHandler? OnNameChanged = null;
public Event<INameable, string> OnNameChanged { get; private set; } = new();
public abstract event IState.StateTransitionReadyEventHandler? OnStateTransitionReady;