/// <summary> /// Opens window to set custom game size. /// </summary> /// <returns>Returns false when user cancels operation. /// Returns true if user enters correct data and accept it.</returns> public bool CreateCustomGame() { bool success = false; CustomFieldCreatorForm customFieldCreator = new CustomFieldCreatorForm(); customFieldCreator.ShowDialog(); if (customFieldCreator.GetisOkPressed()) { this.customGameSize = customFieldCreator.GetCustomGameSize(); CreateGame(3); success = true; } return(success); }
private LastGame lastGame; //used to read and save last difficulty level protected Game() { flagCounter = new FlagCounter(); AddElement(flagCounter); stopwatch = new Stopwatch(); AddElement(stopwatch); gameButton = new GameButton(); AddGameButtonMouseActions(gameButton); AddElement(gameButton); scoreboard = new Scoreboard(); lastGame = new LastGame(); diffLevel = lastGame.GetDifficultyLevel(); customGameSize = lastGame.GetCustomGameSize(); }