chore: get init to only get for events
This commit is contained in:
@@ -6,11 +6,11 @@ namespace Syntriax.Engine.Systems.StateMachine;
|
||||
|
||||
public class State : BaseEntity, IState
|
||||
{
|
||||
public Event<IState> OnStateUpdate { get; init; } = new();
|
||||
public Event<IState, IState.StateTransitionedFromArguments> OnStateTransitionedFrom { get; init; } = new();
|
||||
public Event<IState, IState.StateTransitionedToArguments> OnStateTransitionedTo { get; init; } = new();
|
||||
public Event<IState, IState.StateTransitionReadyArguments> OnStateTransitionReady { get; init; } = new();
|
||||
public Event<INameable, INameable.NameChangedArguments> OnNameChanged { get; init; } = new();
|
||||
public Event<IState> OnStateUpdate { get; } = new();
|
||||
public Event<IState, IState.StateTransitionedFromArguments> OnStateTransitionedFrom { get; } = new();
|
||||
public Event<IState, IState.StateTransitionedToArguments> OnStateTransitionedTo { get; } = new();
|
||||
public Event<IState, IState.StateTransitionReadyArguments> OnStateTransitionReady { get; } = new();
|
||||
public Event<INameable, INameable.NameChangedArguments> OnNameChanged { get; } = new();
|
||||
|
||||
private readonly List<StateTransition> transitions = [];
|
||||
private readonly Dictionary<string, StateTransition> possibleTransitions = [];
|
||||
|
@@ -4,11 +4,11 @@ namespace Syntriax.Engine.Systems.StateMachine;
|
||||
|
||||
public abstract class StateBehaviourBase : Behaviour, IState
|
||||
{
|
||||
public Event<IState> OnStateUpdate { get; init; } = new();
|
||||
public Event<IState, IState.StateTransitionedFromArguments> OnStateTransitionedFrom { get; init; } = new();
|
||||
public Event<IState, IState.StateTransitionedToArguments> OnStateTransitionedTo { get; init; } = new();
|
||||
public Event<IState, IState.StateTransitionReadyArguments> OnStateTransitionReady { get; init; } = new();
|
||||
public Event<INameable, INameable.NameChangedArguments> OnNameChanged { get; init; } = new();
|
||||
public Event<IState> OnStateUpdate { get; } = new();
|
||||
public Event<IState, IState.StateTransitionedFromArguments> OnStateTransitionedFrom { get; } = new();
|
||||
public Event<IState, IState.StateTransitionedToArguments> OnStateTransitionedTo { get; } = new();
|
||||
public Event<IState, IState.StateTransitionReadyArguments> OnStateTransitionReady { get; } = new();
|
||||
public Event<INameable, INameable.NameChangedArguments> OnNameChanged { get; } = new();
|
||||
|
||||
private string _name = string.Empty;
|
||||
public string Name
|
||||
|
@@ -5,7 +5,7 @@ namespace Syntriax.Engine.Systems.StateMachine;
|
||||
|
||||
public class StateMachine : Behaviour
|
||||
{
|
||||
public Event<StateMachine, StateChangedArguments> OnStateChanged { get; init; } = new();
|
||||
public Event<StateMachine, StateChangedArguments> OnStateChanged { get; } = new();
|
||||
|
||||
private readonly Event<IState, IState.StateTransitionReadyArguments>.EventHandler cachedOnStateTransitionReady = null!;
|
||||
|
||||
|
Reference in New Issue
Block a user