您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

21 行
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. }