comparison api/Objects/Army.cs @ 259:35dc06030355

Re #270: Add multiple categories to API * Add "category" attribute to army schema * Add method to define category when adding unit to army * Make army loading check new attribute and assign to correct category or main category TODO: Write out category of unit to army file
author IBBoard <dev@ibboard.co.uk>
date Wed, 19 May 2010 20:07:07 +0000
parents 7f13ffcb8765
children 92d10b06ab0f
comparison
equal deleted inserted replaced
258:3b395ab8784d 259:35dc06030355
167 get { return TotalPoints; } 167 get { return TotalPoints; }
168 } 168 }
169 169
170 public void AddUnit(Unit unit) 170 public void AddUnit(Unit unit)
171 { 171 {
172 ArmyCategory armyCat = GetCategory(unit.UnitType.MainCategory); 172 Category category = unit.UnitType.MainCategory;
173 AddUnit(unit, category);
174 }
175
176 public void AddUnit(Unit unit, Category category)
177 {
178 ArmyCategory armyCat = GetCategory(category);
173 armyCat.AddUnit(unit); 179 armyCat.AddUnit(unit);
174 } 180 }
175 181
176 public void RemoveUnit(Unit unit) 182 public void RemoveUnit(Unit unit)
177 { 183 {