components.rs 500 B

12345678910111213141516171819202122232425262728293031
  1. use specs::prelude::*;
  2. use specs_derive::*;
  3. use rltk::{RGB};
  4. // COMPONENTS
  5. #[derive(Component, Debug)]
  6. pub struct Monster {}
  7. #[derive(Component)]
  8. pub struct Viewshed {
  9. pub visible_tiles : Vec<rltk::Point>,
  10. pub range : i32,
  11. pub dirty: bool
  12. }
  13. #[derive(Component)]
  14. pub struct Position {
  15. pub x: i32,
  16. pub y: i32,
  17. }
  18. #[derive(Component)]
  19. pub struct Renderable {
  20. pub glyph: rltk::FontCharType,
  21. pub fg: RGB,
  22. pub bg: RGB,
  23. }
  24. #[derive(Component, Debug)]
  25. pub struct Player {}