diff 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
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlFactory.cs	Sun Jan 25 14:51:24 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlFactory.cs	Mon Jan 26 20:29:37 2009 +0000
@@ -24,12 +24,18 @@
 	/// </summary>
 	public class WarFoundryXmlFactory : AbstractNativeWarFoundryFactory
 	{
+		private static WarFoundryXmlFactory factory;
 		private Dictionary<IWarFoundryObject, XmlDocument> extraData = new Dictionary<IWarFoundryObject, XmlDocument>();
 		private XmlResolver xmlResolver;
 
-		public static AbstractNativeWarFoundryFactory CreateFactory()
+		public static AbstractNativeWarFoundryFactory GetFactory()
 		{
-			return new WarFoundryXmlFactory();
+			if (factory == null)
+			{
+				factory = new WarFoundryXmlFactory();
+			}
+			
+			return factory;
 		}
 		
 		protected WarFoundryXmlFactory() : base()