private void Commit(object sender, EventArgs e) { try { gameFlowHandler.Commit(); OnCommitted?.Invoke(); ResetControl(); } catch (ArgumentException exception) { MessageBox.Show(exception.Message); } }
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); } }