public void RemoveUnit(Unit unit) { try { _units.Remove(unit); } catch (IndexOutOfRangeException ex) { throw new InvalidOperationException("Could not find Unit " + unit.ToString(), ex); } }
public void AddUnit(Unit unit) { if (!_units.Contains(unit)) { _units.Add(unit); } else { throw new InvalidOperationException("Unit " + unit.ToString() + " already exists!"); } }
public void RemoveUnit(Unit unit, int factory) { _factories[factory].RemoveUnit(unit); }
public void AddUnit(Unit unit, int factory) { _factories[factory].AddUnit(unit); }
//TODO: Phase this out!! protected internal void Register(Unit[] units) { _units = units.ToList(); Initialize(); }