/// <summary> /// XML Loader /// </summary> /// <param name="starSystemName">Cesta k souboru s mapou</param> public static StarSystem LoadStarSystem(String starSystemName) { StreamDataProvider provider = new StreamDataProvider(".//Assets"); provider.Initialize(); StarSystemLoader loader = new StarSystemLoader(); StarSystem starSystem = loader.LoadStarSystem(starSystemName, provider); return(starSystem); }
/// <summary> /// Metoda pro nacteni galaxie /// </summary> /// <param name="galaxyName">Jmeno galaxie</param> /// <returns>Mapa galaxie</returns> public static GalaxyMap LoadGalaxy(String galaxyName) { StreamDataProvider provider = new StreamDataProvider(".//Assets"); provider.Initialize(); GalaxyMapLoader loader = new GalaxyMapLoader(); GalaxyMap galaxyMap = loader.LoadGalaxyMap(galaxyName, provider); if (galaxyMap.Count == 0) { Console.WriteLine("Nezdarilo se otevrit zadny ze zadanych souboru!"); } return(galaxyMap); }