Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison 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 |
comparison
equal
deleted
inserted
replaced
67:e6200220ece3 | 68:10d14a7051d5 |
---|---|
17 private SystemStats sysStats; | 17 private SystemStats sysStats; |
18 | 18 |
19 public Stats(SystemStats systemStats) | 19 public Stats(SystemStats systemStats) |
20 { | 20 { |
21 sysStats = systemStats; | 21 sysStats = systemStats; |
22 stats = new List<Stat>(sysStats.SlotCount); | 22 int statCount = sysStats.SlotCount; |
23 stats = new List<Stat>(statCount); | |
24 | |
25 for (int i = 0; i < statCount; i++) | |
26 { | |
27 stats.Add(null); | |
28 } | |
23 } | 29 } |
24 | 30 |
25 public Stat[] StatsArray | 31 public Stat[] StatsArray |
26 { | 32 { |
27 get { return stats.ToArray(); } | 33 get { return stats.ToArray(); } |