Пример #1
0
        public BoardDirector(DisplayResources displayResources)
        {
            boardProperties = new BoardProperties(displayResources.getNumberOfPlayers());

            this.displayResources = new DisplayResources(
                displayResources.getPlayerNames(),
                displayResources.getPlayerAbvs());

            for (int square40 = 0; square40 < boardPlayerLocations.Length; square40++)
            {
                boardPlayerLocations[square40] = new Boolean[displayResources.getNumberOfPlayers()];

                for (int playerIndex = 0; playerIndex < displayResources.getNumberOfPlayers(); playerIndex++)
                {
                    boardPlayerLocations[square40][playerIndex] = false;
                } //END FOR
            }     //END FOR

            playerBoardLocations = new int[displayResources.getNumberOfPlayers()];

            for (int playerIndex = 0; playerIndex < displayResources.getNumberOfPlayers(); playerIndex++)
            {
                playerBoardLocations[playerIndex] = 0;
            }//END FOR

            for (int playerIndex = 0; playerIndex < displayResources.getNumberOfPlayers(); playerIndex++)
            {
                boardPlayerLocations[0][playerIndex] = true;
            }//END FOR
        }
Пример #2
0
        public TurnResults battle(
            int[] players,
            int propertyValue,
            TurnResults turnResults,
            DisplayResources displayResources)
        {
            int[] order = new int[players.Length];

            int cash = 0;

            int player = 0;

            int place = 0;

            Array.Copy(setOrder(order),
                       order,
                       order.Length);

            for (int index = 0; index < order.Length; index++)
            {
                cash = propertyValue * arrayPropertyMultipliers[players.Length - 2][index];

                player = players[order[index]];

                place = index + 1;

                turnResults.addPlayerCash(player, cash);

                System.Windows.Forms.MessageBox.Show(
                    "Battle " +
                    Convert.ToString(index) +
                    " place " +
                    displayResources.getPlayerName(player) +
                    " cash " +
                    Convert.ToString(cash) +
                    " drinks " +
                    arrayDrinkMultipliers[players.Length - 2][index]);
            }//END FOR

            return(turnResults);
        }
Пример #3
0
        public TurnDirector(DisplayResources displayResources)
        {
            boardDirector = new BoardDirector(displayResources);

            players = new Player[displayResources.getNumberOfPlayers()];

            for (int index = 0; index < displayResources.getNumberOfPlayers(); index++)
            {
                players[index] = new Player();
            }//END FOR

            jail = new Jail(displayResources.getNumberOfPlayers());

            turnResults = new TurnResults(displayResources.getNumberOfPlayers());

            this.displayResources = new DisplayResources(
                displayResources.getPlayerNames(),
                displayResources.getPlayerAbvs());

            intializeValues();
        }