Ejemplo n.º 1
0
        public TieData(TieData DrawDataPassed)
        {
            whiteRequestsDraw = DrawDataPassed.whiteRequestsDraw;
            blackRequestsDraw = DrawDataPassed.blackRequestsDraw;

            numberOfTurnsPlayed   = DrawDataPassed.numberOfTurnsPlayed;
            numberOfTurns3Piece   = DrawDataPassed.numberOfTurns3Piece;
            numberOfTurns5Turn    = DrawDataPassed.numberOfTurns5Turn;
            numberOfTurnsNoStrike = DrawDataPassed.numberOfTurnsNoStrike;
            boardHistory          = new List <Char[]>();
            boardHistory.AddRange(DrawDataPassed.boardHistory);

            tieMessage = DrawDataPassed.tieMessage;
            isTie      = DrawDataPassed.isTie;
        }
Ejemplo n.º 2
0
        public BoardData(InitialBoardStates chosenStart, string colorPlayerStart)
        {
            currentPlayer   = colorPlayerStart;
            currentOpponent = "w";
            if (colorPlayerStart == "w")
            {
                currentOpponent = "b";
            }

            //Fill in the playField
            playField = new char[100];
            PlacePieces(chosenStart);

            //Find all current valid moves
            currentValidMoves = new MoveData(currentPlayer, playField);

            // Construct the DrawData
            currentTieData = new TieData();

            textForDebuggingAi = new List <string>();
        }
Ejemplo n.º 3
0
        private BoardData(char[] endPlayFieldPassed, BoardData boardDataPassed)
        {
            // Copy the boardData
            playField = new Char[100];
            for (int i = 0; i < 100; i++)
            {
                playField[i] = endPlayFieldPassed[i];
            }
            // The playField needs to be updated
            RemoveStrikedPieces();
            ChangeDisksIntoDammen();

            // Who is the current player and who is the opponent
            currentPlayer   = boardDataPassed.currentPlayer;
            currentOpponent = boardDataPassed.currentOpponent;
            // Next Turn
            SwitchPlayer();

            //Find the current Valid Moves
            currentValidMoves = new MoveData(currentPlayer, playField);

            //Debugging Stuff

            /*
             * string writeToConsole = "";
             * for (int i = 0; i < 100; i++)
             * {
             *  if(i%10 == 0)
             *  {
             *      writeToConsole += "\n";
             *  }
             *  writeToConsole += playField[i];
             * }
             * Console.WriteLine(writeToConsole);
             */

            //Copy the DrawData
            currentTieData = new TieData(boardDataPassed.currentTieData);
            UpdataTieData();
        }