Add initial game code
This commit is contained in:
parent
f80a60e208
commit
1383997ebf
55 changed files with 1355 additions and 0 deletions
35
scripts/GameObjects/Planet.cs
Normal file
35
scripts/GameObjects/Planet.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue