diff api/Objects/WarFoundryStagedLoadingObject.cs @ 34:b28be912adab

Re #32 - Migrate to schema * Remove use of Categories (now just has a single category) * Fix infinite loop of trying to load files by adding a "is loading" flag * Fix invalid setting of MinSize to MaxNumber when we're testing if MinSize > MaxSize
author IBBoard <dev@ibboard.co.uk>
date Sun, 15 Mar 2009 16:07:52 +0000
parents 306558904c2a
children 9cac51553fd1
line wrap: on
line diff
--- a/api/Objects/WarFoundryStagedLoadingObject.cs	Sun Mar 15 15:10:02 2009 +0000
+++ b/api/Objects/WarFoundryStagedLoadingObject.cs	Sun Mar 15 16:07:52 2009 +0000
@@ -11,6 +11,7 @@
 	public class WarFoundryStagedLoadingObject : WarFoundryObject, IWarFoundryStagedLoadObject
 	{
 		private bool isFullyLoaded;
+		private bool isLoading;
 		private IWarFoundryFactory creatingFactory;
 		private FileInfo sourceFile;
 		
@@ -36,7 +37,7 @@
 		
 		public void EnsureFullyLoaded ()
 		{
-			if (!IsFullyLoaded)
+			if (!IsFullyLoaded && !IsLoading)
 			{
 				if (Factory == null)
 				{
@@ -57,9 +58,19 @@
 			get { return isFullyLoaded; }
 		}
 		
+		public bool IsLoading
+		{
+			get { return isLoading; }
+		}
+		
 		public void SetAsFullyLoaded()
 		{
 			isFullyLoaded = true;
 		}
+		
+		public void SetAsLoading()
+		{
+			isLoading = true;
+		}
 	}
 }