public WindowsUI(string i_Title, PositiveRange i_BoardRange) { r_BoardRange = i_BoardRange; //todo: is still required? // r_ParamsDialog = new ParamsDialogForm(i_BoardRange); //todo: ENFORCE MAX TEXT SIZE!!!!!!!!!!!! otherwise names very long.. also enforce computer name // r_ParamsDialog.Show(); // r_ReversedTicTacToeParams = new ReversedTicTacToeParams(r_ParamsDialog.GameType, r_ParamsDialog.BoardSize, r_ParamsDialog.PlayerNames); r_ReversedTicTacToeParams = new ReversedTicTacToeParams(new GameType(GameType.eGameType.PlayerVsPlayer), 5, new string[] { "Player 1", "PPP" }); r_BoardCellChoosingRange = new TwoDimensionalPositiveRange(k_BoardMinChoice, r_ReversedTicTacToeParams.BoardSize, k_BoardMinChoice, r_ReversedTicTacToeParams.BoardSize); r_GameWindow = new GameWindowForm(i_Title, r_ReversedTicTacToeParams.BoardSize); }
// Get's point input from the user. // 'i_ExcludingStr' is another input that we can recv. in that case will return null public static Point?GetPointFromUser(TwoDimensionalPositiveRange i_Range, string i_ExcludingStr, uint i_DecreaseBY) { Point?retPoint = null; uint? row = GetPositiveNumberFromUser("Insert Row Number:", i_Range.Y, i_ExcludingStr); uint? col = null; if (row.HasValue) { col = GetPositiveNumberFromUser("Insert Col Number:", i_Range.X, i_ExcludingStr); } if (row.HasValue && col.HasValue) { retPoint = new Point(col.Value - i_DecreaseBY, row.Value - i_DecreaseBY); } return(retPoint); }