public void NextStageLevelLoad() { activeLevelConfiguration.IncreaseStageLevelNumber(); OnStageLevelChanged?.Invoke(activeLevelConfiguration.StageLevelNumberInfo()); ChangeConfigurationsValuesOnWinStageLevel(); Debug.Log("Win and increased stage level"); DefaultLevel.Load(activeLevelConfiguration); }
public void Save_Click() { if (SelectedLine == null) { MessageBox.Show("Please select a Line"); return; } Setting.DefaultLevel = DefaultLevel; Setting.DefaultLots = DefaultLots; Setting.SelectedLine = SelectedLine; Setting.WorkingMode = SelectedWorkingMode; TextHelper.WriteToSetting("SelectedProduct", JsonConvert.SerializeObject(Setting.SelectedProduct)); TextHelper.WriteToSetting("SelectedLine", JsonConvert.SerializeObject(SelectedLine)); TextHelper.WriteToSetting("DefaultLevel", DefaultLevel.ToString()); TextHelper.WriteToSetting("DefaultLots", DefaultLots.ToString()); TextHelper.WriteToSetting("WorkingMode", SelectedWorkingMode.ToString()); TextHelper.SaveToFile(); }
/// <summary> /// Writes the diagnostic message at the default level. /// </summary> /// <param name="messageFunc"> /// A function returning message to be written. Function is not evaluated if logging is not /// enabled. /// </param> public void Log(Func <String> messageFunc) => _internalLogger.Log(DefaultLevel.ToLogLevel(), new LogMessageGenerator(messageFunc));
/// <summary> /// Writes the diagnostic message at the default level. /// </summary> /// <param name="message">The message to log</param> public void Log(String message) => _internalLogger.Log(DefaultLevel.ToLogLevel(), message);
public void RefundLevelSettings() { ResetLevel(); activeLevelConfiguration.RefundLevelSettings(startLevelConfigurationParameters); DefaultLevel.Load(activeLevelConfiguration); }
public void RestartLevel() { DefaultLevel.Load(activeLevelConfiguration); }
public void LoadLevel(ActiveLevelConfiguration activeLevelConfiguration) { DefaultLevel.Load(activeLevelConfiguration); }
public void NextStageLevelLoad(ActiveLevelConfiguration activeLevelConfiguration) { DefaultLevel.Load(activeLevelConfiguration); }
public void ActivateLevel(LevelConfiguration levelConfiguration) { activeLevelConfiguration.ResetStageLevelNumber(); activeLevelConfiguration.ChangeParameters(levelConfiguration.Parameters); DefaultLevel.Load(activeLevelConfiguration); }
public LevelValue GetSettingsCopy(int level) { return((_levels.Count <= level ? null : _levels[level]) ?? DefaultLevel.GetValueOrDefault()); }
protected override void OnNavigatedTo(NavigationEventArgs e) { // Set the sharing mode of the graphics device to turn on XNA rendering SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(true); graphics = SharedGraphicsDeviceManager.Current.GraphicsDevice; game.Run(); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(SharedGraphicsDeviceManager.Current.GraphicsDevice); var environment = new Conesoft.Game.DefaultEnvironment() { Random = new Random(), ModelBoundaries = new Dictionary <string, BoundingSphere>() }; game.Resources.Load((to, from) => { to.Models.Add(from.Load <Model>(Data.Ship, Data.Drone, Data.Spaceship)); to.Sprites.Add(from.Load <Texture2D>(Data.Fireball, Data.Energyball, Data.Bullet, Data.Grass, Data.TutorialOverlay, Data.GameWonOverlay, Data.GameOverOverlay)); var texture = new Texture2D(graphics, 1, 1); texture.SetData(new Color[] { Color.Black }); to.Sprites.Add(Data.BlackBackground, texture); to.Sounds.Add(from.Load <SoundEffect>(Data.ExplosionSound, Data.GameOverSound, Data.GoSound, Data.GoodSound, Data.LaserSound)); to.Fonts.Add(from.Load <SpriteFont>(Data.Font, Data.SmallFont)); var terrainModel = new TerrainModel() { Position = Vector3.Down * 64 * 32, Size = new Vector3(1024 * 128, 256 * 32, 1024 * 128) }; terrainModel.LoadFromTexture2D(from.Load <Texture2D>(Data.LandscapeGround), environment); to.Terrains.Add(Data.Landscape, terrainModel); foreach (var model in to.Models) { var boundingSphere = default(BoundingSphere); foreach (var mesh in model.Value.Meshes) { boundingSphere = BoundingSphere.CreateMerged(boundingSphere, mesh.BoundingSphere); } environment.ModelBoundaries[model.Key] = boundingSphere; } }); environment.Sounds = game.Resources.Sounds; // Start the timer timer.Start(); App.Current.Appl.NavigationService.NavigateTo <LastManStandingLevel>(); level = new DefaultLevel(environment); var spaceShips = level.Objects3D.OfType <Spaceship>(); if (spaceShips.Count() > 0) { localPlayer = new LocalPlayer() { ControlledObject = spaceShips.First() }; level.Players.Add(localPlayer); } startTime = null; fadeInTime = App.Current.FirstTime ? 3 : 1; App.Current.FirstTime = false; base.OnNavigatedTo(e); }