comparison FrmMainWindow.cs @ 18:c4d9b1ec75ed

Re #124: Remove "factory factory" * Replace calls to factory factory with direct invocation of "get factory" methods in GTK# UI
author IBBoard <dev@ibboard.co.uk>
date Sat, 15 Aug 2009 09:33:51 +0000
parents 7653fab9d70e
children a191d0655f55
comparison
equal deleted inserted replaced
17:7653fab9d70e 18:c4d9b1ec75ed
127 UnitRemovedMethod = new ObjectRemoveDelegate(OnUnitRemoved); 127 UnitRemovedMethod = new ObjectRemoveDelegate(OnUnitRemoved);
128 PointsValueChangedMethod = new DoubleValChangedDelegate(OnPointsValueChanged); 128 PointsValueChangedMethod = new DoubleValChangedDelegate(OnPointsValueChanged);
129 FailedUnitRequirementMethod = new FailedUnitRequirementDelegate(OnFailedUnitRequirement); 129 FailedUnitRequirementMethod = new FailedUnitRequirementDelegate(OnFailedUnitRequirement);
130 UnitNameChangedMethod = new StringValChangedDelegate(OnUnitNameChanged); 130 UnitNameChangedMethod = new StringValChangedDelegate(OnUnitNameChanged);
131 131
132 //FIXME: Temporary hack to add paths and factories 132 //FIXME: Temporary hack to add paths and factories before we get preferences and plugins
133 WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + "data")); 133 WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + "data"));
134 IWarFoundryFactory factory = WarFoundryFactoryFactory.GetFactoryFactory().GetFactory(typeof(WarFoundryXmlFactory)); 134 WarFoundryLoader.GetDefault().RegisterFactory(WarFoundryXmlFactory.GetFactory());
135 135 WarFoundryLoader.GetDefault().RegisterNonNativeFactory(RollcallFactory.GetFactory());
136 if (factory!=null && factory is WarFoundryXmlFactory)
137 {
138 WarFoundryLoader.GetDefault().RegisterFactory((WarFoundryXmlFactory)factory);
139 }
140
141 factory = WarFoundryFactoryFactory.GetFactoryFactory().GetFactory(typeof(RollcallFactory));
142
143 if (factory!=null && factory is RollcallFactory)
144 {
145 WarFoundryLoader.GetDefault().RegisterNonNativeFactory((INonNativeWarFoundryFactory)factory);
146 }
147 136
148 logger.Debug("Initialising complete - seeing if we can load default army or system"); 137 logger.Debug("Initialising complete - seeing if we can load default army or system");
149 138
150 if (args.Length == 1) 139 if (args.Length == 1)
151 { 140 {