Exemplo n.º 1
0
        private void Deploying(object sender, EventArgs e)
        {
            nextButton.Enabled = true;
            ResetStateHighlight(State);

            // committing phase
            if (State > GameState.Deploying)
            {
                gameFlowHandler.ResetAttacking();
            }

            State = GameState.Deploying;

            // highlight button
            HighlightCorrectButton(State);

            OnDeploying?.Invoke();
        }
Exemplo n.º 2
0
        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);
            }
        }