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 diff
     1.1 --- a/API/Objects/Army.cs	Mon Aug 29 16:47:54 2011 +0100
     1.2 +++ b/API/Objects/Army.cs	Mon Aug 29 20:57:47 2011 +0100
     1.3 @@ -26,7 +26,8 @@
     1.4  		private Dictionary<Category, ArmyCategory> categories;
     1.5  
     1.6  		public event ObjectAddDelegate UnitAdded;
     1.7 -		public event ObjectRemoveDelegate UnitRemoved;
     1.8 +		public event ObjectRemoveDelegate UnitRemoved;
     1.9 +		public event IntValChangedDelegate MaxPointsValueChanged;
    1.10  		public event DoubleValChangedDelegate PointsValueChanged;
    1.11  		private DoubleValChangedDelegate PointsValueChangedMethod;
    1.12  		
    1.13 @@ -183,7 +184,13 @@
    1.14  			{
    1.15  				if (value > 0)
    1.16  				{
    1.17 -					maxPoints = value;
    1.18 +					int oldPoints = maxPoints;
    1.19 +					maxPoints = value;
    1.20 +
    1.21 +					if (MaxPointsValueChanged != null)
    1.22 +					{
    1.23 +						MaxPointsValueChanged(this, oldPoints, maxPoints);
    1.24 +					}
    1.25  				}
    1.26  			}
    1.27  		}