Changeset 146 for IBBoard.WarFoundry.API/trunk/api/Objects/Unit.cs
- Timestamp:
- 06/27/09 14:39:04 (14 months ago)
- Files:
-
- 1 modified
-
IBBoard.WarFoundry.API/trunk/api/Objects/Unit.cs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
IBBoard.WarFoundry.API/trunk/api/Objects/Unit.cs
r143 r146 18 18 private UnitType type; 19 19 private int size; 20 private Army army;21 20 private Unit parentUnit; 22 21 private double points; … … 28 27 public event DoubleValChangedDelegate UnitEquipmentAmountChanged; 29 28 30 public Unit(UnitType unitType, Army parentArmy) : this(unitType, unitType.MinSize, parentArmy){}31 32 public Unit(UnitType unitType, int startSize, Army parentArmy)33 { 34 Army = parentArmy;29 public Unit(UnitType unitType, ArmyCategory parentArmyCat) : this(unitType, unitType.MinSize, parentArmyCat) { } 30 31 public Unit(UnitType unitType, int startSize, ArmyCategory parentArmyCat) 32 { 33 Category = parentArmyCat; 35 34 type = unitType; 36 35 Size = startSize; … … 144 143 public Army Army 145 144 { 146 get { return army; } 147 set 148 { 149 army = value; 150 151 if (army == null) 152 { 153 Category = null; 154 } 155 } 145 get { return (Category == null ? null : Category.ParentArmy); } 156 146 } 157 147 … … 163 153 public ArmyCategory Category 164 154 { 165 get 166 { 167 if (cat==null) 168 { 169 if (Army!=null) 170 { 171 return Army.GetCategory(UnitType.MainCategory); 172 } 173 else 174 { 175 return null; 176 } 177 } 178 else 179 { 180 return cat; 181 } 155 get 156 { 157 return cat; 182 158 } 183 159 set { cat = value; }
WarFoundry - Development