Ejemplo n.º 1
0
 /**
  *
  */
 private bool LoadSaveFile()
 {
     if (MyAPIGateway.Utilities.FileExistsInWorldStorage(SAVEFILE_NAME, typeof(FSTCData)))
     {
         try {
             TextReader reader = MyAPIGateway.Utilities.ReadFileInWorldStorage(SAVEFILE_NAME, typeof(FSTCData));
             FSTCData   data   = MyAPIGateway.Utilities.SerializeFromXML <FSTCData>(reader.ReadToEnd());
             reader.Close();
             if (data != null)
             {
                 GlobalData.world = data;
                 return(true);
             }
         } catch {
             Util.Error("Corrupt save data.");
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        public static FSTCData Get()
        {
            FSTCData ret = new FSTCData();

            // True Hostiles
            ret.empires.Add(EmpireSPRT());
            ret.empires.Add(EmpireSHVN());

            // Hostiles
            ret.empires.Add(EmpireSYND());

            // Neutrals
            ret.empires.Add(EmpireEIEF());
            ret.empires.Add(EmpireIFTA());
            ret.empires.Add(EmpireXGTC());

            // Police
            ret.empires.Add(EmpireUEFA());

            return(ret);
        }