comparison api/Objects/Stats.cs @ 252:a54da5a8b5bb

Re #268: Restructure stats for re-use * Add "Member Type" class * Add member type setting and getting to Race * Load member types from XML files * Make unit type pull stat line from stats or first member type, or fall back to a blank stat line * Change Stats object to initialise blank values * Change schema * Make stats optional * Add member type list to race * Add optional member type references to units
author IBBoard <dev@ibboard.co.uk>
date Sun, 25 Apr 2010 15:07:08 +0000
parents ece26f6a62f3
children cdda78975be1
comparison
equal deleted inserted replaced
251:22509bd03ca2 252:a54da5a8b5bb
18 public Stats(SystemStats systemStats) 18 public Stats(SystemStats systemStats)
19 { 19 {
20 sysStats = systemStats; 20 sysStats = systemStats;
21 int statCount = sysStats.SlotCount; 21 int statCount = sysStats.SlotCount;
22 stats = new List<Stat>(statCount); 22 stats = new List<Stat>(statCount);
23 int i = 0;
23 24
24 for (int i = 0; i < statCount; i++) 25 foreach (StatSlot slot in sysStats.StatSlots)
25 { 26 {
26 stats.Add(null); 27 stats.Add(new Stat(slot, ""));
27 } 28 }
28 } 29 }
29 30
30 public Stat[] StatsArray 31 public Stat[] StatsArray
31 { 32 {