private void GameModeSelected(String gameModeName) { if (String.IsNullOrEmpty(gameModeName)) { return; } GameModeInfo gameMode = _service.GetGameModeInfos().FirstOrDefault(gamemode => gamemode.Name == gameModeName); IRegion regionGameModeDetails = _regionManager.Regions[RegionNames.RegionGameModeDetails]; if (regionGameModeDetails == null) { return; } GameModeDetails view = regionGameModeDetails.GetView(ViewNames.GameModeDetails) as GameModeDetails; if (view == null) { view = _container.Resolve <GameModeDetails>(); regionGameModeDetails.Add(view, ViewNames.GameModeDetails); } else { regionGameModeDetails.Activate(view); } GameModeDetailsViewModel viewModel = view.DataContext as GameModeDetailsViewModel; if (viewModel != null) { viewModel.CurrentGameModeInfo = gameMode; } }
public GameMode() { Easy = new GameModeInfo(1f, 0, 3); Medium = new GameModeInfo(0.5f, 1, 3); Hard = new GameModeInfo(0.25f, 3, 6); Insane = new GameModeInfo(0.25f, 4, 10); }
/// <summary> /// Select game mode which should be activated when the server starts. /// </summary> public void SelectGameMode(GameModeInfo gameModeInfo) { if (m_activeGameMode != null) { throw new Exception("Can not select game mode if there is an active game mode"); } m_selectedGameMode = gameModeInfo; }
private void SelectedGameInfoChanged(object sender, EventArgs e) { GameModeInfo gameMode = this.GameModeInfos.CurrentItem as GameModeInfo; if (gameMode != null) { this._eventAggregator.GetEvent <GameModeSelectedEvent>().Publish(gameMode.Name); } }
private void LoadModeInfo() { TwoPlayerToggle.isOn = GameMaster.instance.twoPlayersActive; PlayTutorialToggle.isOn = GameMaster.instance.playTutorial; currentMode = GameMaster.instance.GameInfoArray[CurrentModeIndex]; NameText.text = currentMode.Name; DescriptionText.text = currentMode.Desc; ObjectiveText.text = currentMode.Objective; HighScoreValueText.text = System.Convert.ToString(currentMode.HighScore); }
private void ActivateGameMode(GameModeInfo gameModeInfo) { if (m_activeGameMode != null) { if (m_activeGameMode == gameModeInfo) { throw new Exception($"Can not activate game mode '{gameModeInfo.Name}' because it is already activated"); } throw new Exception($"Can not activate game mode '{gameModeInfo.Name}' because another one ('{m_activeGameMode.Name}') is already activated"); } m_activeGameMode = gameModeInfo; gameModeInfo.ActivationCallback(); }
void Start() { if (GameMaster.instance.MainMenuSelectionReturn) { MainPanel.SetActive(false); ModePanel.SetActive(true); } else { GameMaster.instance.LoadData(); GameMaster.instance.MainMenuSelectionReturn = true; } currentMode = GameMaster.instance.GameInfoArray[0]; ModeListLength = GameMaster.instance.GameInfoArray.Length; LoadModeInfo(); }
private void InstantiateGameInfo() { GameInfoArray[0] = new GameModeInfo("Classic", "Based on the original arcade game 'Asteroids'.", "Aim to destroy as many aliens and asteroids as you can, lives are limited and as rounds progress the difficulty increases. " + "A new life is gained every 2000 points (Max 6).", 0); GameInfoArray[1] = new GameModeInfo("Survival", "Fly between space stations and stay alive for as long as possible. Spend earned points at the space stations to get repairs and upgrades. " + "Similar to classic but with new powerups.", "Aim to destroy as many asteroids as you can, aliens are worth more points and be super careful of the shooting asteroids.", 0); GameInfoArray[2] = new GameModeInfo("Dodgestroids", "Dodgeball but with asteroids... only for the crazy pilots. ", "Dodge the shooting asteroids as they come. There are no weapons provided. Good Luck.", 0); }
/// <summary> /// A simple constructor that initializes the object with the given values. /// </summary> /// <param name="p_eifEnvironmentInfo">The application's environment info.</param> public GameModeBase(IEnvironmentInfo p_eifEnvironmentInfo) { EnvironmentInfo = p_eifEnvironmentInfo; m_gmdGameModeInfo = CreateGameModeDescriptor(); GameModeEnvironmentInfo = new GameModeInfo(this, p_eifEnvironmentInfo); }
/// <summary> /// A simple constructor that initializes the object with the given values. /// </summary> /// <param name="p_eifEnvironmentInfo">The application's environment info.</param> public GameModeBase(IEnvironmentInfo p_eifEnvironmentInfo) { EnvironmentInfo = p_eifEnvironmentInfo; m_gmdGameModeInfo = CreateGameModeDescriptor(); GameModeEnvironmentInfo = new GameModeInfo(this, p_eifEnvironmentInfo); }
GameMode(GameModeInfo _mode) { mode = _mode; }
public void RegisterGameMode(GameModeInfo gameModeInfo) { m_gameModes.Add(gameModeInfo); }