Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

21 wiersze
454 B

  1. use amethyst::ecs::{Component, DenseVecStorage};
  2. // a struct to represent an object in space which has mass and follows
  3. // orbital mechanics
  4. pub struct CelestialBody {
  5. pub mass: u128,
  6. pub x: i128,
  7. pub y: i128,
  8. }
  9. impl CelestialBody {
  10. // create a new celestial body
  11. pub fn new(mass: u128, x: i128, y: i128) -> Self {
  12. Self { mass, x, y }
  13. }
  14. }
  15. impl Component for CelestialBody {
  16. type Storage = DenseVecStorage<Self>;
  17. }