TODO: Comments. Clean up. Refactor.
Inheritance: System.Entity
Exemple #1
0
 public void RemoveUnit(Unit unit)
 {
     try
     {
         _units.Remove(unit);
     }
     catch (IndexOutOfRangeException ex)
     {
         throw new InvalidOperationException("Could not find Unit " + unit.ToString(), ex);
     }
 }
Exemple #2
0
 public void AddUnit(Unit unit)
 {
     if (!_units.Contains(unit))
     {
         _units.Add(unit);
     }
     else
     {
         throw new InvalidOperationException("Unit " + unit.ToString() + " already exists!");
     }
 }
Exemple #3
0
 public void RemoveUnit(Unit unit, int factory)
 {
     _factories[factory].RemoveUnit(unit);
 }
Exemple #4
0
 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();
 }