Example #1
0
        private void AddBody(CelestialBodyWithCore obj)
        {
            if (_bodies.Contains(obj))
            {
                return;
            }

            _bodies.Add(obj);
        }
Example #2
0
        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);
        }
Example #3
0
 public void Remove(CelestialBodyWithCore obj)
 {
     _bodies.Remove(obj);
 }