comparison api/Factories/Xml/WarFoundryXmlFactory.cs @ 17:a99d3b8466ba

Change "CreateFactory" method to "GetFactory" method to allow for caching no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Mon, 26 Jan 2009 20:29:37 +0000
parents 306558904c2a
children f9846f896df3
comparison
equal deleted inserted replaced
16:bf518618eb69 17:a99d3b8466ba
22 /// <summary> 22 /// <summary>
23 /// The WarFoundryXmlFactory loads WarFoundry classes from the native "XML in a zip" file format. Files are validated using the schema for the file type, so structurally invalid files should be identified at initial load. 23 /// The WarFoundryXmlFactory loads WarFoundry classes from the native "XML in a zip" file format. Files are validated using the schema for the file type, so structurally invalid files should be identified at initial load.
24 /// </summary> 24 /// </summary>
25 public class WarFoundryXmlFactory : AbstractNativeWarFoundryFactory 25 public class WarFoundryXmlFactory : AbstractNativeWarFoundryFactory
26 { 26 {
27 private static WarFoundryXmlFactory factory;
27 private Dictionary<IWarFoundryObject, XmlDocument> extraData = new Dictionary<IWarFoundryObject, XmlDocument>(); 28 private Dictionary<IWarFoundryObject, XmlDocument> extraData = new Dictionary<IWarFoundryObject, XmlDocument>();
28 private XmlResolver xmlResolver; 29 private XmlResolver xmlResolver;
29 30
30 public static AbstractNativeWarFoundryFactory CreateFactory() 31 public static AbstractNativeWarFoundryFactory GetFactory()
31 { 32 {
32 return new WarFoundryXmlFactory(); 33 if (factory == null)
34 {
35 factory = new WarFoundryXmlFactory();
36 }
37
38 return factory;
33 } 39 }
34 40
35 protected WarFoundryXmlFactory() : base() 41 protected WarFoundryXmlFactory() : base()
36 { 42 {
37 xmlResolver = new IBBXmlResolver(Constants.ExecutablePath); 43 xmlResolver = new IBBXmlResolver(Constants.ExecutablePath);