public GameSettings(GameMode.PlayingMode gameMode, GameCategory selectedCategory, bool sound, Color cardColor) { GameMode = gameMode; SelectedCategory = selectedCategory; Sound = sound; CardColor = cardColor; CalculateWidth(); CalculateHeight(); }
/// <summary> /// Starts the game with the selected settings (game mode, game cateogry, sound and card color) by the user. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void StartGame() { GameMode.PlayingMode selectedMode = GetSelectedMode(); GameCategory selectedCateogry = GetSelectedCategory(); bool sound = GetSound(); Color selectedColor = GetColor(); GameSettings gameSettings = new GameSettings(selectedMode, selectedCateogry, sound, selectedColor); this.Hide(); if (selectedMode == GameMode.PlayingMode.SinglePlayer) { Scene = new SingleplayerScene(gameSettings, this); } if (selectedMode == GameMode.PlayingMode.MultiPlayer) { Scene = new MultiplayerScene(gameSettings, this); } Scene.ShowDialog(); }