comparison api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs @ 179:c1caf467dd40

Re #193: Unhandled exception in dictionary? * Make defaultStats attribute required by schema Also: * Remove some references to log notifier
author IBBoard <dev@ibboard.co.uk>
date Sat, 24 Oct 2009 15:00:36 +0000
parents 2f3cafb69799
children 08a9c960e17f 4e0031339bcb
comparison
equal deleted inserted replaced
178:ca2cd24f6872 179:c1caf467dd40
2 // 2 //
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. 3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
4 4
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.IO;
7 using System.Xml; 8 using System.Xml;
8 using ICSharpCode.SharpZipLib.Zip; 9 using ICSharpCode.SharpZipLib.Zip;
9 using IBBoard.Logging;
10 using IBBoard.Xml; 10 using IBBoard.Xml;
11 using IBBoard.WarFoundry.API.Objects; 11 using IBBoard.WarFoundry.API.Objects;
12 12
13 namespace IBBoard.WarFoundry.API.Factories.Xml 13 namespace IBBoard.WarFoundry.API.Factories.Xml
14 { 14 {
59 LoadSystemStatsForSystem(system, extraData); 59 LoadSystemStatsForSystem(system, extraData);
60 system.StandardSystemStatsID = defaultStatsID; 60 system.StandardSystemStatsID = defaultStatsID;
61 XmlElement systemElement = WarFoundryXmlFactoryUtils.SelectSingleElement(extraData, "/system:system"); 61 XmlElement systemElement = WarFoundryXmlFactoryUtils.SelectSingleElement(extraData, "/system:system");
62 system.WarnOnError = XmlTools.GetBoolValueFromAttribute(systemElement, "warn"); 62 system.WarnOnError = XmlTools.GetBoolValueFromAttribute(systemElement, "warn");
63 system.AllowAllies = XmlTools.GetBoolValueFromAttribute(systemElement, "allowAllies"); 63 system.AllowAllies = XmlTools.GetBoolValueFromAttribute(systemElement, "allowAllies");
64 LogNotifier.DebugFormat(GetType(), "Completed loading of GameSystem with ID {0}", system.ID);
65 LogNotifier.DebugFormat(GetType(), "GameSystem with ID {0} default stats: {1}", system.ID, system.StandardSystemStatsID);
66 system.SetAsFullyLoaded(); 64 system.SetAsFullyLoaded();
67 } 65 }
66
68 67
69 private void LoadCategoriesForSystem(GameSystem system, XmlNode elem) 68 private void LoadCategoriesForSystem(GameSystem system, XmlNode elem)
70 { 69 {
71 foreach (XmlElement cat in WarFoundryXmlFactoryUtils.SelectNodes(elem, "/system:system/system:categories/cat:cat")) 70 foreach (XmlElement cat in WarFoundryXmlFactoryUtils.SelectNodes(elem, "/system:system/system:categories/cat:cat"))
72 { 71 {