Beispiel #1
0
        private static void gameRoutine()
        {
            while (Utils.CharExistsInMatrix(GameDataMatrix.DisplayMatrix, ' '))
            {
                GameLogic.SetCurrentPlayer();

                for (byte i = 0; i < 2; i++)
                {
                    string move = GameLogic.GetNextMove(i);
                    GameLogic.PlayerTurn(i, move);
                    byte[] check = UI.MoveToByteArray(move);
                    DrawBoard.UpdateBoard(check[0], check[1]);
                }

                GameLogic.MatchingPair();
                GameLogic.m_GameTurn++;
            }

            GameLogic.GameResult();
        }
Beispiel #2
0
        public static void PlayerTurn(byte i_Turn, string i_Move)
        {
            if (i_Turn == 0)
            {
                if (GameLogic.m_CurrentPlayer == Utils.FirstPlayer && Utils.SecondPlayer == "computer")
                {
                    GameLogic.m_CurrentPlayerFirstMove = i_Move;
                }

                GameLogic.m_FirstCellPick = UI.MoveToByteArray(i_Move);
            }
            else
            {
                if (GameLogic.m_CurrentPlayer == Utils.FirstPlayer && Utils.SecondPlayer == "computer")
                {
                    GameLogic.m_CurrentPlayerSecondMove = i_Move;
                }

                GameLogic.m_SecondCellPick = UI.MoveToByteArray(i_Move);
            }
        }