示例#1
0
        /**
         * Simulates the Dice roll. Then calls a method to perform
         * a start-of-turn action.
         */
        public void RollDice()
        {
            int       roll  = Dice.Instance.Roll(window);
            FieldType field = FieldType.VISIT;

            for (int i = 0; i < roll; i++)
            {
                field = gameplan.Move(currentPlayer);
                window.MovePlayer(playerTurnPointer,
                                  gameplan.GetCoordsOfNextField(currentPlayer, playerTurnPointer));
                if (gameplan.PlayerPosition(currentPlayer) == 0)
                {
                    currentPlayer.Money += START_BONUS;
                    window.ShowPlayerInfo(currentPlayer);
                    if (currentPlayer is HumanPlayer)
                    {
                        MessageBox.Show("You have passed the start and 30m have been added to your account");
                    }
                }
                Thread.Sleep(200);
            }
            Action(field, roll);
        }