diff api/Objects/Stats.cs @ 68:10d14a7051d5

Re #50 - Complete core loading of WarFoundry XML files * Start to restructure loading so that we can use pre-existing objects * Break unit loading in to methods Also: * Pad stats list with nulls because setting capacity doesn't let you set arbitrary indexes * Add GameSystem property to UnitType
author IBBoard <dev@ibboard.co.uk>
date Sat, 25 Apr 2009 19:18:11 +0000
parents e6200220ece3
children 032b174fc17a
line wrap: on
line diff
--- a/api/Objects/Stats.cs	Sat Apr 25 14:59:23 2009 +0000
+++ b/api/Objects/Stats.cs	Sat Apr 25 19:18:11 2009 +0000
@@ -19,7 +19,13 @@
 		public Stats(SystemStats systemStats)
 		{
 			sysStats = systemStats;
-			stats = new List<Stat>(sysStats.SlotCount);
+			int statCount = sysStats.SlotCount;
+			stats = new List<Stat>(statCount);
+
+			for (int i = 0; i < statCount; i++)
+			{
+				stats.Add(null);
+			}
 		}
 		
 		public Stat[] StatsArray