comparison api/Objects/Stats.cs @ 81:032b174fc17a

Re #10 - Refactoring for readability * Remove "trainwreck code" by making Unit and UnitType publish methods to get arrays of stats * Remove "trainwreck code" by making Unit, UnitType and Stats publish methods to get value of one stat * Make factory use new methods
author IBBoard <dev@ibboard.co.uk>
date Wed, 27 May 2009 19:43:09 +0000
parents 10d14a7051d5
children 2f3cafb69799
comparison
equal deleted inserted replaced
80:aa66dd18cdae 81:032b174fc17a
81 { 81 {
82 throw new ArgumentException(Translation.GetTranslation("InvalidStatPos", "Invalid statistic position {0} for stats based on system stats set {1}", new object[]{pos, sysStats.ID})); 82 throw new ArgumentException(Translation.GetTranslation("InvalidStatPos", "Invalid statistic position {0} for stats based on system stats set {1}", new object[]{pos, sysStats.ID}));
83 } 83 }
84 } 84 }
85 } 85 }
86
87 public string GetStatValue(string id)
88 {
89 return this[id].SlotValueString;
90 }
86 91
87 public int StatCount 92 public int StatCount
88 { 93 {
89 get { return stats.Count; } 94 get { return stats.Count; }
90 } 95 }