Esempio n. 1
0
        private void SteppedOnCommunityChestSpace(Player[] players, IList <Space> listOfSpaces,
                                                  CommunityChestSpace CommunityChestSpaceObject, ChanceSpace ChanceSpaceObject, int currentPlayerCounter,
                                                  Player player, Space currentSpace)
        {
            ChanceCard drawCommunityChestCard = CommunityChestSpaceObject.DrawCard();

            if (drawCommunityChestCard is SpaceCard)
            {
                SpaceCard drawChanceCardAsSpaceCard = drawCommunityChestCard as SpaceCard;
                player.Position = drawChanceCardAsSpaceCard.PositionToGo;
                currentSpace    = listOfSpaces[player.Position];
                CheckSpaces(players, listOfSpaces, CommunityChestSpaceObject, ChanceSpaceObject, currentPlayerCounter, player, currentSpace);
            }
            if (drawCommunityChestCard is MoveCard)
            {
                MoveCard drawChanceCardAsMoveCard = drawCommunityChestCard as MoveCard;
                player.Position = drawChanceCardAsMoveCard.SquaresToMove + player.Position;
                currentSpace    = listOfSpaces[player.Position];
                CheckSpaces(players, listOfSpaces, CommunityChestSpaceObject, ChanceSpaceObject, currentPlayerCounter, player, currentSpace);
            }
            if (drawCommunityChestCard is GoodLuckCard)
            {
                GoodLuckCard drawChanceCardAsMoveCard = drawCommunityChestCard as GoodLuckCard;
                player.AddCash((int)drawChanceCardAsMoveCard.Cash);
            }
        }