public Sonic4Ep1() { Sonic4Ep1.pInstance = this; AppMain.storePath = System.IO.Directory.GetCurrentDirectory(); var config = XmlStorage.Load(); if (config == null) { config = new Sonic4Save(); } var backup = gs.backup.SSave.CreateInstance(); backup.SetSave(config); XmlStorage.Save(config, false, false); this.graphics = new GraphicsDeviceManager((Game)this); this.graphics.PreferredBackBufferWidth = 480 * 3; this.graphics.PreferredBackBufferHeight = 288 * 3; this.graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft; this.graphics.PreparingDeviceSettings += new EventHandler <PreparingDeviceSettingsEventArgs>(this.graphics_PreparingDeviceSettings); this.graphics.SynchronizeWithVerticalRetrace = true; this.graphics.IsFullScreen = false; this.IsMouseVisible = true; this.Content.RootDirectory = "Content"; this.TargetElapsedTime = TimeSpan.FromSeconds(1d / 60); this.Activated += new EventHandler <EventArgs>(OnActivated); this.Deactivated += new EventHandler <EventArgs>(OnDeactivated); }
public SStage(Sonic4Save save) { this.save = save; for (int i = 0; i < c_size; i++) { stages[i] = new SStageSolo(save.Stages[i]); } }
public SSpecial(Sonic4Save save) { this.save = save; for (int i = 0; i < 7; i++) { stages[i] = new SSpecialSolo(save.SpecialStages[i]); } }
internal static void Save(Sonic4Save save, bool createNew, bool delete) { try { var str = Path.Combine(AppMain.storePath, AppMain.g_ao_storage_filename); var writer = new XmlSerializer(typeof(gs.Sonic4Save)); using (var storageFileStream = File.Open(str, FileMode.OpenOrCreate)) { storageFileStream.SetLength(0); writer.Serialize(storageFileStream, save); } saveSuccess = true; } catch (Exception ex) { saveSuccess = false; lastError = 2; Console.WriteLine(ex); } }
public void Init(Sonic4Save save = null) { if (this.save != null) { return; } this.save = save = save ?? new Sonic4Save(); for (int index = 0; index < 1; ++index) { this.m_system[index] = new SSystem(save); this.m_system[index].Init(); this.m_option[index] = new SOption(save); this.m_option[index].Init(); this.m_stage[index] = new SStage(save); this.m_stage[index].Init(); this.m_special[index] = new SSpecial(save); this.m_special[index].Init(); this.m_remaster[index] = new SRemaster(save); this.m_remaster[index].Init(); this.m_debug[index] = new SDebug(save); this.m_debug[index].Init(); } }
public SDebug(Sonic4Save save) { this.save = save; }
public SRemaster(Sonic4Save save) { this.save = save; }
public void SetSave(Sonic4Save value) { Init(value); }
public SOption(Sonic4Save save) { this.save = save; }
public SSystem(Sonic4Save save) { this.save = save; }