public void ZipRetrieveLocalSector() { string filename = Path.Combine(TestingUtilities.Config["DataPath"], "LocalSector.zip"); if (!File.Exists(filename)) { ZipStoreLocalSector(); } IStellarMap map; IMapStorage store = MapStorageFactory.GetStorage(MapStorageFactory.ZipStorage); using StreamReader reader = new StreamReader(filename); map = store.Retreive <ProgressionMap>(reader); // now serialize it to json file to inspect filename = Path.Combine(TestingUtilities.Config["DataPath"], "LocalSectorCheck.json"); if (File.Exists(filename)) { File.Delete(filename); } store = MapStorageFactory.GetStorage(MapStorageFactory.JsonStorage); using StreamWriter writer = new StreamWriter(filename); store.Store(map, writer); }
public void ZipStoreSolarSystem() { IStellarMap map = SolarSystem.CreateSolSystem(); IMapStorage store = MapStorageFactory.GetStorage(MapStorageFactory.ZipStorage); string filename = Path.Combine(TestingUtilities.Config["DataPath"], "SolarSystem.zip"); if (File.Exists(filename)) { File.Delete(filename); } using StreamWriter writer = new StreamWriter(filename); store.Store(map, writer); }
public static void StoreSolarSystem() { IStellarMap map = new BaseStellarMap("SolarSystem"); PhysicalSolarSystemCreator.CreateSolarSystem(map); IMapStorage store = MapStorageFactory.GetStorage(MapStorageFactory.JsonStorage); string filename = Path.Combine(dataDir, "SolarSystem.json"); if (File.Exists(filename)) { File.Delete(filename); } using StreamWriter writer = new StreamWriter(filename); store.Store(map, writer); }
public void ZipStoreLocalSector() { ProgressionMap localsector = new ProgressionMap("Local Sector"); LocalSectorMap create = new LocalSectorMap(localsector); create.CreateLocalSector(); IMapStorage store = MapStorageFactory.GetStorage(MapStorageFactory.ZipStorage); string filename = Path.Combine(TestingUtilities.Config["DataPath"], "LocalSector.zip"); if (File.Exists(filename)) { File.Delete(filename); } using StreamWriter writer = new StreamWriter(filename); store.Store(localsector, writer); }
public static void JsonGenerateLocalSector() { ProgressionMap localsector = new ProgressionMap("Local Sector"); LocalSectorMap create = new LocalSectorMap(localsector); create.CreateLocalSector(); IMapStorage store = MapStorageFactory.GetStorage(MapStorageFactory.JsonStorage); string filename = Path.Combine(dataDir, "LocalSector.json"); if (File.Exists(filename)) { File.Delete(filename); } using StreamWriter writer = new StreamWriter(filename); store.Store(localsector, writer); }