private void Committing(object sender, EventArgs e) { nextButton.Enabled = true; ResetStateHighlight(State); // committing phase State = GameState.Committing; // highlight HighlightCorrectButton(State); OnCommitting?.Invoke(); }
private void InvokeStateEvent(GameState state) { switch (state) { case GameState.Deploying: OnDeploying?.Invoke(); break; case GameState.Attacking: OnAttacking?.Invoke(); break; case GameState.Committing: OnCommitting?.Invoke(); break; case GameState.Committed: OnCommitted?.Invoke(); break; default: throw new ArgumentOutOfRangeException(nameof(state), state, null); } }