Exemple #1
0
        internal void TurnStart(ActivePlayer player)
        {
            if (!_isMulliganDone)
            {
                _game.Process(ChooseTask.Mulligan(_game.Player1, _toBeKept));
                _game.Process(ChooseTask.Mulligan(_game.Player2, _game.Player2.Choice.Choices));
            }
            _isMulliganDone = true;
            _isNewTurn      = true;
            _activePlayer   = player;
            _numberOfTurns++;

            if (_numberOfTurns > 1)
            {
                ProcessPlayerAction();
                _game.MainEnd();
                _game.MainNext();
            }

            GameV2 gameV2 = Core.Game;

            if (player == ActivePlayer.Player)
            {
                _messenger.Reset();
                _messenger.SetTitle("Turn " + gameV2.GetTurnNumber());
            }
            Converter.AreGamesInSync(_game, gameV2);
        }
Exemple #2
0
        /// <summary>Invokes the method which corresponds to the next simulation step.</summary>
        /// <param name="game">The game subject.</param>
        /// <param name="step">The (next) step value.</param>
        /// <exception cref="ArgumentOutOfRangeException">step - when the provided step is unknown</exception>
        public void NextStepEvent(Game game, Step step)
        {
            game.Log(LogLevel.DEBUG, BlockType.TRIGGER, "Event", !game.Logging? "":$"NextStepEvent - {step}");
            switch (step)
            {
            case Step.BEGIN_FIRST:
                game.Step = step;
                game.BeginFirst();
                break;

            case Step.BEGIN_SHUFFLE:
                game.Step = step;
                game.BeginShuffle();
                break;

            case Step.BEGIN_DRAW:
                game.Step = step;
                game.BeginDraw();
                break;

            case Step.BEGIN_MULLIGAN:
                game.Step = step;
                game.BeginMulligan();
                break;

            case Step.MAIN_BEGIN:
                game.Step = step;
                game.MainBegin();
                break;

            case Step.MAIN_DRAW:
                game.Step = step;
                game.MainDraw();
                break;

            case Step.MAIN_READY:
                game.Step = step;
                game.MainReady();
                break;

            case Step.MAIN_RESOURCE:
                game.Step = step;
                game.MainRessources();
                break;

            case Step.MAIN_START:
                game.Step = step;
                game.MainStart();
                break;

            case Step.MAIN_START_TRIGGERS:
                game.Step = step;
                game.MainStartTriggers();
                break;

            case Step.MAIN_ACTION:
                game.Step = step;
                break;

            case Step.MAIN_COMBAT:
                break;

            case Step.MAIN_CLEANUP:
                game.Step = step;
                game.MainCleanUp();
                break;

            case Step.MAIN_END:
                game.Step = step;
                game.MainEnd();
                break;

            case Step.MAIN_NEXT:
                game.Step = step;
                game.MainNext();
                break;

            case Step.FINAL_WRAPUP:
                game.FinalWrapUp();
                break;

            case Step.FINAL_GAMEOVER:
                game.FinalGameOver();
                break;

            case Step.INVALID:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(step), step, null);
            }
        }