diff 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
line wrap: on
line diff
--- a/api/Objects/Army.cs	Sat Sep 19 14:12:57 2009 +0000
+++ b/api/Objects/Army.cs	Sat Sep 19 19:42:53 2009 +0000
@@ -17,7 +17,7 @@
 	/// <summary>
 	/// Summary description for Army.
 	/// </summary>
-	public class Army : WarFoundryObject
+	public class Army : WarFoundryObject, ICostedWarFoundryObject
 	{
 		//private GameSystem system;
 		private Race armyRace;
@@ -156,11 +156,17 @@
 			}
 		}
 
+		[Obsolete("Use Points instead")]
 		public double PointsTotal
 		{
 			get { return TotalPoints; }
 		}
 		
+		public double Points
+		{
+			get { return TotalPoints; }
+		}
+		
 		public void AddUnit(Unit unit)
 		{
 			ArmyCategory armyCat = GetCategory(unit.UnitType.MainCategory);
@@ -214,7 +220,7 @@
 
 				foreach (ArmyCategory cat in Categories)
 				{
-					points+= cat.PointsTotal;
+					points+= cat.Points;
 				}
 
 				TotalPoints = points;