Пример #1
0
        public void Simulate()
        {
            for (int i = 0; i < NumberOfIterations; i++)
            {
                Reporter.StartRound();
                Reporter.AddInitialSpace(_gameboard.PositionOfPlayer);

                var eyes = _dice.Roll();
                Reporter.AddRollResult(eyes);

                var turnResult = _gameboard.MoveByDiceResult(eyes);
                Reporter.AddRollDestinationSpace(_gameboard.PositionOfPlayer);

                Reporter.AddSpaceAction(turnResult.Action.ToString());

                switch (turnResult.Action)
                {
                case AdditionalAction.GoToJail:
                    _gameboard.MoveToJail();
                    Reporter.AddSpaceActionDestinationSpace(_gameboard.PositionOfPlayer);
                    break;

                case AdditionalAction.DrawGreenCard:
                    DrawCard(_greenCards);
                    break;

                case AdditionalAction.DrawRedCard:
                    DrawCard(_redCards);
                    break;

                case AdditionalAction.None:
                    break;
                }

                Reporter.EndRound();
            }
        }