public Game(Board <T> i_Board, ref Player io_FirstPlayer, ref Player io_SecondPlayer) { m_Board = i_Board; m_FirstPlayer = io_FirstPlayer; m_SecondPlayer = io_SecondPlayer; m_UserActivety = new UserActivety <T>(); m_Random = new Random(); }
public Board(int i_Length, int i_Hight, List <T> i_ValueList) { Hight = i_Hight; Length = i_Length; NumOfExposedCards = 0; m_Random = new Random(); m_UserActivity = new UserActivety <T>(); m_MatrixToShow = new T[Hight, Length]; m_Matrix = new T[Hight, Length]; setMatrixValues(i_ValueList); }
private static void runApp() { CharValues values = new CharValues(); UserActivety <char?> userActivity = new UserActivety <char?>(); Player firstPlayer = new Player(); Player secondPlayer = new Player(); int length = 0, hight = 0; bool newGame = true; userActivity.GetMainPlayerInput(ref firstPlayer, ref secondPlayer); while (newGame) { userActivity.GetBoardSize(ref length, ref hight); Board <char?> board = new Board <char?>(length, hight, values.CharList); Game <char?> game = new Game <char?>(board, ref firstPlayer, ref secondPlayer); userActivity.PrintBoard(board); game.PlayGame(); newGame = userActivity.StartNewGame(); } userActivity.Print("****** Game Over! Bye Bye ******"); }