public static void RunGame() { Console.WriteLine(" ======== Welcome to Our Memory Game ======== "); int width, lenght; bool isUserOneHuman = true, isUserTwoHuman = false; string userName1 = GetUserName(); string userName2 = null; MemoryGame.eGameType gameType = ChooseAGameType(); if (gameType == MemoryGame.eGameType.AgainstAnotherUser) { userName2 = GetUserName(); isUserTwoHuman = true; } GetBoardSize(out width, out lenght); MemoryGame game = new MemoryGame(userName1, userName2, isUserOneHuman, isUserTwoHuman, gameType, lenght, width); PlayGame(game); bool anotherGame = isTostartAnotherGame(); if (anotherGame) { Ex02.ConsoleUtils.Screen.Clear(); RunGame(); } else { Console.WriteLine(); Console.WriteLine("Thank You and have a nice day :)"); System.Threading.Thread.Sleep(3000); } }
public MemoryGame(string i_FirstUserName, string i_SecondUserName, bool i_IsFirstUserHuman, bool i_IsSecondUserHuman, MemoryGame.eGameType i_GameType, int i_Lenght, int i_Width) { m_GameType = i_GameType; m_GameTurn = eGameTurn.FirstUser; m_Board = new Board(i_Lenght, i_Width); m_UserPlayer1 = new User(i_FirstUserName, i_IsFirstUserHuman, 0); m_UserPlayer2 = new User(i_SecondUserName, i_IsSecondUserHuman, m_Board.MaxPairCards / 2); }