Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }