35 lines
997 B
C#
35 lines
997 B
C#
using System.Collections.Generic;
|
|
|
|
public partial class Planet : GameObject
|
|
{
|
|
public bool IsMoon { get; private set; }
|
|
public long Diameter { get; private set; }
|
|
|
|
public List<GameObject> OrbitingGameObjects { get; private set; }
|
|
public List<GameObject> PlanetGameObjects { get; private set; }
|
|
|
|
public Planet(string name, CoordinateVector position, GameObject parent, bool isMoon, long diameter)
|
|
: base(name, position, new CoordinateVector(0, 0), parent)
|
|
{
|
|
this.IsMoon = isMoon;
|
|
this.Diameter = diameter;
|
|
|
|
this.OrbitingGameObjects = new List<GameObject>();
|
|
this.PlanetGameObjects = new List<GameObject>();
|
|
}
|
|
|
|
public override void Simulate()
|
|
{
|
|
base.Simulate();
|
|
|
|
foreach (GameObject gameObject in this.OrbitingGameObjects)
|
|
{
|
|
gameObject.Simulate();
|
|
}
|
|
|
|
foreach (GameObject gameObject in this.PlanetGameObjects)
|
|
{
|
|
gameObject.Simulate();
|
|
}
|
|
}
|
|
}
|