components.rs 588 B

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