add_new_number( int number) //itt lehet majd újat hozzáadni a tablelayout-hoz úgyhogy a megfelelő sort és oszlop számot megadjuk { if (number < 10000) { if (is_place_for_btn()) { var random = new Random(); int randomRow; int randomColoumn; do { randomRow = random.Next(0, _aSide); randomColoumn = random.Next(0, _aSide); } while (check_gameare_place(randomRow, randomColoumn)); GameButton.set_btn_number(_gameButtons[randomRow, randomColoumn], number.ToString()); //game_Buttons[random_row, random_coloumn].Text = number.ToString(); _gameButtons[randomRow, randomColoumn].GetChildAt(0) .SetBackgroundColor(_gameButton.get_color_from_number(number)); _gombPlace[randomRow, randomColoumn] = 1; //van ott már egy szám _informationContainer.add_point(number); //save_game_Area_(); } else { New_game(); } } else { bigger_then_the_biggest(); } }
private static void load_saved_scene(ViewGroup tableLayout, int aSide) { var saveGameArea = new SaveGameArea(); var getSavedData = saveGameArea.GetGame_Area_(aSide); var gameButton = new GameButton(); for (var i = 0; i < aSide; i++) { for (var j = 0; j < aSide; j++) { var tableRow = (TableRow)tableLayout.GetChildAt(i); var border = (FrameLayout)tableRow.GetChildAt(j); var frameLayout = (FrameLayout)border.GetChildAt(0); if (getSavedData != null) { if (getSavedData.Values[i, j] <= 0) { continue; } frameLayout.SetBackgroundColor(gameButton.get_color_from_number(getSavedData.Values[i, j])); GameButton.set_btn_number(border, getSavedData.Values[i, j].ToString()); } else { return; } } } }