コード例 #1
0
ファイル: Scenario.cs プロジェクト: rw2-hub/LocoSwap
        public void Load(string routeId, string id)
        {
            RouteId = routeId;
            Id      = id;

            try
            {
                ScenarioProperties = XmlDocumentLoader.Load(Path.Combine(ScenarioDirectory, "ScenarioProperties.xml"));
                XElement displayName = ScenarioProperties.XPathSelectElement("/cScenarioProperties/DisplayName/Localisation-cUserLocalisedString");
                Name = Utilities.DetermineDisplayName(displayName);
            }
            catch (Exception e)
            {
                Log.Warning("Exception caught when trying to load ScenarioProperties.xml: {0}", e);
                throw new Exception("Malformed ScenarioProperties.xml file!");
            }
        }