Add initial game code

This commit is contained in:
Aslan 2025-09-12 08:34:06 -04:00
parent f80a60e208
commit 1383997ebf
55 changed files with 1355 additions and 0 deletions

View file

@ -0,0 +1,35 @@
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();
}
}
}