diff api/AbstractWarFoundryLoader.cs @ 313:f00a57369aaa

Re #253: Allow multiple data files in a single zip * Add event-based mechanism to allow GameSystem to be registered before Race is loaded from a single zip
author IBBoard <dev@ibboard.co.uk>
date Sun, 27 Feb 2011 15:54:13 +0000
parents b24a78cfd314
children bd5d8bfe18a6
line wrap: on
line diff
--- a/api/AbstractWarFoundryLoader.cs	Sat Feb 26 20:15:12 2011 +0000
+++ b/api/AbstractWarFoundryLoader.cs	Sun Feb 27 15:54:13 2011 +0000
@@ -341,18 +341,11 @@
 
 		private bool LoadObject(FileInfo file, IWarFoundryFactory factory)
 		{
-			bool loaded = false;
-			
 			LogNotifier.DebugFormat(GetType(), "Loading {0} using {1}", file.FullName, factory.GetType().Name);
+			factory.RaceLoaded+= StoreRace;
+			factory.GameSystemLoaded+= StoreGameSystem;
 			ICollection<IWarFoundryObject> objects = factory.CreateObjectsFromFile(file);
-			
-			if (objects.Count > 0)
-			{
-				AddLoadedObjects(objects, factory);
-				loaded = true;
-			}
-
-			return loaded;
+			return objects.Count > 0;
 		}