comparison api/Objects/Army.cs @ 143:7f13ffcb8765 WarFoundry_v0.1beta2_Winforms

Re #164: Show unit cost in army tree * Do prep work and create "ICostedWarFoundryObject" interface that defines objects with a "Points" property * Implement new interface where necessary * Deprecate old variations on "points value" * Remove references to deprecated code
author IBBoard <dev@ibboard.co.uk>
date Sat, 19 Sep 2009 19:42:53 +0000
parents 2f3cafb69799
children 35dc06030355
comparison
equal deleted inserted replaced
142:b4d1ed685490 143:7f13ffcb8765
15 namespace IBBoard.WarFoundry.API.Objects 15 namespace IBBoard.WarFoundry.API.Objects
16 { 16 {
17 /// <summary> 17 /// <summary>
18 /// Summary description for Army. 18 /// Summary description for Army.
19 /// </summary> 19 /// </summary>
20 public class Army : WarFoundryObject 20 public class Army : WarFoundryObject, ICostedWarFoundryObject
21 { 21 {
22 //private GameSystem system; 22 //private GameSystem system;
23 private Race armyRace; 23 private Race armyRace;
24 private int maxPoints; 24 private int maxPoints;
25 private double pointsTotal; 25 private double pointsTotal;
154 OnPointsValueChanged(oldPoints, pointsTotal); 154 OnPointsValueChanged(oldPoints, pointsTotal);
155 } 155 }
156 } 156 }
157 } 157 }
158 158
159 [Obsolete("Use Points instead")]
159 public double PointsTotal 160 public double PointsTotal
161 {
162 get { return TotalPoints; }
163 }
164
165 public double Points
160 { 166 {
161 get { return TotalPoints; } 167 get { return TotalPoints; }
162 } 168 }
163 169
164 public void AddUnit(Unit unit) 170 public void AddUnit(Unit unit)
212 { 218 {
213 double points = 0; 219 double points = 0;
214 220
215 foreach (ArmyCategory cat in Categories) 221 foreach (ArmyCategory cat in Categories)
216 { 222 {
217 points+= cat.PointsTotal; 223 points+= cat.Points;
218 } 224 }
219 225
220 TotalPoints = points; 226 TotalPoints = points;
221 } 227 }
222 } 228 }