changeset 414:3f297a60db1e

Re #101: Make army names and sizes modifiable after creation * Add "size changed" event
author IBBoard <dev@ibboard.co.uk>
date Mon, 29 Aug 2011 20:57:47 +0100
parents 48098a2d17d0
children 131fb56da842
files API/Objects/Army.cs
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/API/Objects/Army.cs	Mon Aug 29 16:47:54 2011 +0100
+++ b/API/Objects/Army.cs	Mon Aug 29 20:57:47 2011 +0100
@@ -26,7 +26,8 @@
 		private Dictionary<Category, ArmyCategory> categories;
 
 		public event ObjectAddDelegate UnitAdded;
-		public event ObjectRemoveDelegate UnitRemoved;
+		public event ObjectRemoveDelegate UnitRemoved;
+		public event IntValChangedDelegate MaxPointsValueChanged;
 		public event DoubleValChangedDelegate PointsValueChanged;
 		private DoubleValChangedDelegate PointsValueChangedMethod;
 		
@@ -183,7 +184,13 @@
 			{
 				if (value > 0)
 				{
-					maxPoints = value;
+					int oldPoints = maxPoints;
+					maxPoints = value;
+
+					if (MaxPointsValueChanged != null)
+					{
+						MaxPointsValueChanged(this, oldPoints, maxPoints);
+					}
 				}
 			}
 		}