Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison api/WarFoundryCore.cs @ 129:52cacdbcb001
Fixes #126: First army load fails
* Re-order setting of army and setting of game system to resolve null army issues
Also:
* Remove commented and unused code
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 26 Aug 2009 19:00:50 +0000 |
parents | 2f3cafb69799 |
children |
comparison
equal
deleted
inserted
replaced
128:45a9452579a2 | 129:52cacdbcb001 |
---|---|
52 get { return currentArmy; } | 52 get { return currentArmy; } |
53 set | 53 set |
54 { | 54 { |
55 if (currentArmy==null || !currentArmy.Equals(value)) | 55 if (currentArmy==null || !currentArmy.Equals(value)) |
56 { | 56 { |
57 /*if (currentArmy!=null) | 57 Army oldArmy = currentArmy; |
58 | |
59 if (value != null) | |
58 { | 60 { |
59 currentArmy.UnitAdded-= UnitAddedMethod; | 61 CurrentGameSystem = value.GameSystem; //Set the game system in case the new army is from a different system |
60 currentArmy.UnitRemoved-= UnitRemovedMethod; | 62 currentArmy = value; |
61 currentArmy.PointsValueChanged-= PointsValueChangedMethod; | 63 } |
62 currentArmy.FailedRequirement-=FailedUnitRequirementMethod; | 64 else |
63 }*/ | 65 { |
64 Army oldArmy = currentArmy; | 66 currentArmy = null; |
65 currentArmy = value; | 67 } |
66 | 68 |
67 if (currentArmy!=null) | |
68 { | |
69 CurrentGameSystem = currentArmy.GameSystem; //Set the game system in case the new army is from a different system | |
70 } | |
71 | |
72 /*if (currentArmy!=null) | |
73 { | |
74 currentArmy.UnitAdded+= UnitAddedMethod; | |
75 currentArmy.UnitRemoved+= UnitRemovedMethod; | |
76 currentArmy.PointsValueChanged+= PointsValueChangedMethod; | |
77 currentArmy.FailedRequirement+=FailedUnitRequirementMethod; | |
78 }*/ | |
79 | |
80 if (ArmyChanged!=null) | 69 if (ArmyChanged!=null) |
81 { | 70 { |
82 ArmyChanged(oldArmy, currentArmy); | 71 ArmyChanged(oldArmy, currentArmy); |
83 } | 72 } |
84 } | 73 } |