changeset 295:f8f441f2fcfe

Re #323: WarFoundry.API - SystemStats cannot remove stat Update SystemStats Implement RemoveStatSlot
author Tsudico
date Sat, 18 Dec 2010 20:53:52 +0000
parents 52985d48b263
children ed5e6d92ecd9
files api/Objects/SystemStats.cs
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/api/Objects/SystemStats.cs	Fri Dec 17 20:40:30 2010 +0000
     1.2 +++ b/api/Objects/SystemStats.cs	Sat Dec 18 20:53:52 2010 +0000
     1.3 @@ -52,6 +52,14 @@
     1.4  			return stats.IndexOf(slot);
     1.5  		}
     1.6  		
     1.7 +		public void RemoveStatSlot(string name)
     1.8 +		{
     1.9 +			statsByName.Remove(name);
    1.10 +			StatSlot slot = new StatSlot(name);
    1.11 +			slot.SystemStats = this;
    1.12 +			stats.Remove(slot);
    1.13 +		}
    1.14 +		
    1.15          public int SlotCount
    1.16          {
    1.17              get { return stats.Count; }