comparison api/Objects/SystemStats.cs @ 181:8c6f55d289b0

Fixes #200: Stats names should be case-insensitive * ToLower() all stat names/IDs so that they are case-insensitive
author IBBoard <dev@ibboard.co.uk>
date Sat, 24 Oct 2009 15:18:00 +0000
parents 2f3cafb69799
children f8f441f2fcfe
comparison
equal deleted inserted replaced
180:55dc7c97fcfe 181:8c6f55d289b0
25 25
26 public void AddStatSlot(string slotName) 26 public void AddStatSlot(string slotName)
27 { 27 {
28 StatSlot slot = new StatSlot(slotName); 28 StatSlot slot = new StatSlot(slotName);
29 slot.SystemStats = this; 29 slot.SystemStats = this;
30 statsByName[slot.Name] = slot; 30 statsByName[slot.Name.ToLower()] = slot;
31 stats.Add(slot); 31 stats.Add(slot);
32 } 32 }
33 33
34 public StatSlot[] StatSlots 34 public StatSlot[] StatSlots
35 { 35 {
41 41
42 public StatSlot this[string statName] 42 public StatSlot this[string statName]
43 { 43 {
44 get 44 get
45 { 45 {
46 return DictionaryUtils.GetValue(statsByName, statName); 46 return DictionaryUtils.GetValue(statsByName, statName.ToLower());
47 } 47 }
48 } 48 }
49 49
50 public int GetStatSlotPosition(StatSlot slot) 50 public int GetStatSlotPosition(StatSlot slot)
51 { 51 {