private void AddBody(CelestialBodyWithCore obj) { if (_bodies.Contains(obj)) { return; } _bodies.Add(obj); }
private void AddStar(CelestialBodyWithCore obj) { if (_bodies.Contains(obj)) { return; } if (_bodies.FindAll(core => core.GetType() == typeof(Star)).Count >= 3) { throw new Exception("A solar system cannot have more than 3 stars."); } _bodies.Add(obj); }
public void Remove(CelestialBodyWithCore obj) { _bodies.Remove(obj); }