Beispiel #1
0
 public void RemoveUnit(Unit unit)
 {
     try
     {
         _units.Remove(unit);
     }
     catch (IndexOutOfRangeException ex)
     {
         throw new InvalidOperationException("Could not find Unit " + unit.ToString(), ex);
     }
 }
Beispiel #2
0
 public void RemoveUnit(Unit unit)
 {
     try
     {
         _units.Remove(unit);
     }
     catch (IndexOutOfRangeException ex)
     {
         throw new InvalidOperationException("Could not find Unit " + unit.ToString(), ex);
     }
 }
Beispiel #3
0
 public void AddUnit(Unit unit)
 {
     if (!_units.Contains(unit))
     {
         _units.Add(unit);
     }
     else
     {
         throw new InvalidOperationException("Unit " + unit.ToString() + " already exists!");
     }
 }
Beispiel #4
0
 public void AddUnit(Unit unit)
 {
     if (!_units.Contains(unit))
     {
         _units.Add(unit);
     }
     else
     {
         throw new InvalidOperationException("Unit " + unit.ToString() + " already exists!");
     }
 }