|
- use amethyst::ecs::{Component, DenseVecStorage};
-
- // a struct to represent an object in space which has mass and follows
- // orbital mechanics
- pub struct CelestialBody {
- pub mass: u128,
- pub x: i128,
- pub y: i128,
- }
-
- impl CelestialBody {
- // create a new celestial body
- pub fn new(mass: u128, x: i128, y: i128) -> Self {
- Self { mass, x, y }
- }
- }
-
- impl Component for CelestialBody {
- type Storage = DenseVecStorage<Self>;
- }
|