Map.h 907 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef INCLUDE_MAP_H
  2. #define INCLUDE_MAP_H
  3. #include "Camera.h"
  4. #include "Entity.h"
  5. #include "TileRenderer.h"
  6. #include "Animator.h"
  7. namespace WalrusRPG
  8. {
  9. class Map
  10. {
  11. protected:
  12. // <Tiles> data;
  13. // <Tileset> tileset;
  14. unsigned int width;
  15. unsigned int height;
  16. unsigned *layer0;
  17. unsigned *layer1;
  18. TileRenderer *renderer;
  19. Animator anim;
  20. unsigned time_render;
  21. // TODO?: add a boolean/getter to know if a second layer exist?
  22. public:
  23. Map(int width, int height, unsigned *layer0, unsigned *layer1);
  24. ~Map();
  25. void render(Camera &camera, unsigned dt);
  26. void update(unsigned dt);
  27. bool is_tile_solid(unsigned x, unsigned y) const;
  28. bool is_pixel_solid(unsigned x, unsigned y) const;
  29. unsigned get_width() const;
  30. unsigned get_height() const;
  31. };
  32. }
  33. #endif