Ejemplo n.º 1
0
        //Purpose: Set up the start of the game, including game board, dice, playingstates, etc..
        public void StartGame()
        {
            //Create gameDoard
            OurGame.gameBoard = new GameBoard(OurGame.gameType);
            //Create gameDice
            OurGame.gameDice = new Dice();
            ai = new AI();
            currentTrade = new Trade();
            gameCard = new GameCard(OurGame, this);
            lr = new LongestRoad(OurGame, this);

            //Create players array and randomize
            OurGame.players = new List<Player>();
            OurGame.players.Add(new Player(1, OurGame.gameBoard));
            OurGame.players.Add(new Player(2, OurGame.gameBoard));
            OurGame.players.Add(new Player(3, OurGame.gameBoard));

            //Randomize players List
            Random rnd = new Random();
            int n = OurGame.players.Count;
            while (n > 1)
            {
                n--;
                int k = rnd.Next(n + 1);
                Player value = OurGame.players[k];
                OurGame.players[k] = OurGame.players[n];
                OurGame.players[n] = value;
            }
            //Assign players
            OurGame.aiPlayer1 = OurGame.players[0];
            OurGame.aiPlayer2 = OurGame.players[1];
            OurGame.humanPlayer = OurGame.players[2];

            rolledDice = false;
            humanPlayerTurn = false;
            aiTurn = false;
            turnWaitCounter = 0;
            roadCardCounter = 1;

            //Create the GUIs for the game
            gameBoardGraphics = new DrawGameBoard2D(Game, this);
            Game.Components.Add(gameBoardGraphics);

            gameHud = new DrawHud(Game, this);
            Game.Components.Add(gameHud);

            //Set game playing state booleans
            movingRobber = false;
            chooseTheft = false;
            gameStartMode = true;
            firstTimeThrough = true;
            monopolyMode = false;
            yearOfPlentyMode = false;
            roadCard = false;

            //Set trading booleans
            aiOneResponse = false;
            aiTwoResponse = false;
            aiResponded = false;

            aiDesiresTrade = false;
            aiRequestsTradeFromHuman = false;
            humanResponded = false;
            humanAcceptsTrade = false;

            robberGiveAway = false;

            //Set Bools for building actions
            buildingSettlement = false;
            buildingCity = false;
            buildingRoad = false;

            playerTurn = 1;
        }
Ejemplo n.º 2
0
        //Purpose: Set up the start of the game, including game board, dice, playingstates, etc..
        public void StartGame()
        {
            //Create gameDoard
            OurGame.gameBoard = new GameBoard(OurGame.gameType);
            //Create gameDice
            OurGame.gameDice = new Dice();
            ai = new AI();

            //Create players array and randomize
            OurGame.players = new List<Player>();
            OurGame.players.Add(new Player(1));
            OurGame.players.Add(new Player(2));
            OurGame.players.Add(new Player(3));

            //Randomize players List
            Random rnd = new Random();
            int n = OurGame.players.Count;
            while (n > 1)
            {
                n--;
                int k = rnd.Next(n + 1);
                Player value = OurGame.players[k];
                OurGame.players[k] = OurGame.players[n];
                OurGame.players[n] = value;
            }
            //Assign players
            OurGame.aiPlayer1 = OurGame.players[0];
            OurGame.aiPlayer2 = OurGame.players[1];
            OurGame.humanPlayer = OurGame.players[2];

            rolledDice = false;
            humanPlayerTurn = false;
            aiTurn = false;
            turnWaitCounter = 0;
            roadCardCounter = 0;

            //Create the GUIs for the game
            gameBoardGraphics = new DrawGameBoard2D(Game, this);
            Game.Components.Add(gameBoardGraphics);

            gameHud = new DrawHud(Game, this);
            Game.Components.Add(gameHud);

            //Set game playing state booleans
            movingRobber = false;
            gameStartMode = true;
            firstTimeThrough = true;

            //Set Bools for building actions
            buildingSettlement = false;
            buildingCity = false;
            buildingRoad = false;

            playerTurn = 1;
        }