Пример #1
0
    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);
    }
Пример #2
0
 public SStage(Sonic4Save save)
 {
     this.save = save;
     for (int i = 0; i < c_size; i++)
     {
         stages[i] = new SStageSolo(save.Stages[i]);
     }
 }
Пример #3
0
 public SSpecial(Sonic4Save save)
 {
     this.save = save;
     for (int i = 0; i < 7; i++)
     {
         stages[i] = new SSpecialSolo(save.SpecialStages[i]);
     }
 }
Пример #4
0
    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);
        }
    }
Пример #5
0
        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();
            }
        }
Пример #6
0
 public SDebug(Sonic4Save save)
 {
     this.save = save;
 }
Пример #7
0
 public SRemaster(Sonic4Save save)
 {
     this.save = save;
 }
Пример #8
0
 public void SetSave(Sonic4Save value)
 {
     Init(value);
 }
Пример #9
0
 public SOption(Sonic4Save save)
 {
     this.save = save;
 }
Пример #10
0
 public SSystem(Sonic4Save save)
 {
     this.save = save;
 }