Ejemplo n.º 1
0
            public State(State i_PrevState)
            {
                m_LastAddedCell = new Cell();
                Board copyBoard = new Board(i_PrevState.m_Board.Size);

                copyBoard.CopyBoard(i_PrevState.Board);
                m_Board      = copyBoard;
                m_CurrPlayer = i_PrevState.CurrPlayer;
            }
Ejemplo n.º 2
0
        internal Cell GetPlayerChoise(Game.WhoIsPlaying i_Player, ref bool io_FirstTry, ref bool io_IsEnterQ)
        {
            bool validCellChoose = false;
            Cell inputCell       = new Cell();

            while (!validCellChoose)
            {
                if (io_FirstTry)
                {
                    string whosTurn = string.Format("Player {0} Turn: ", i_Player == Game.WhoIsPlaying.Player1 ? "1" : "2");
                    Output.PrintToScreen(whosTurn);
                }
                else
                {
                    Output.PrintToScreen("ERROR! Your Input Is Not Valid.");
                }

                Output.PrintToScreen("Please Enter Your Next Cell Move,Enter Row and Then Column: ");
                string[] numbersStr = Console.ReadLine().Split();
                io_IsEnterQ = IsEnterQ(numbersStr);

                if (io_IsEnterQ)
                {
                    break;
                }

                int row = 0, col = 0;
                if (IsValidstring(numbersStr, ref row, ref col))
                {
                    validCellChoose = true;
                    inputCell.Row   = row;
                    inputCell.Col   = col;
                }

                io_FirstTry = false;
            }

            return(inputCell);
        }
Ejemplo n.º 3
0
 internal Cell GetPlayerChoise(Game.WhoIsPlaying i_Player, ref bool io_FirstTry, ref bool io_IsEnterQ)
 {
     return m_Input.GetPlayerChoise(i_Player, ref io_FirstTry, ref io_IsEnterQ);
 }
Ejemplo n.º 4
0
 public State(Board i_Board)
 {
     m_LastAddedCell = new Cell();
     m_Board         = i_Board;
     m_CurrPlayer    = Game.WhoIsPlaying.Computer;
 }
Ejemplo n.º 5
0
 public Player(Game.WhoIsPlaying name, char symbol)
 {
     m_Name     = name;
     m_Symbol   = symbol;
     m_ScoreNum = 0;
 }