Map.h 847 B

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