A 2D tile-based sandbox game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Tile.h 424B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <stdint.h>
  3. #include <string>
  4. #include <SFML/Graphics/Image.hpp>
  5. namespace Swan {
  6. class Tile {
  7. public:
  8. using ID = uint16_t;
  9. std::string path_;
  10. std::string name_;
  11. sf::Image image_;
  12. bool is_solid_ = true;
  13. Tile(std::string path): path_(path) {}
  14. Tile *solid(bool b) { is_solid_ = b; return this; }
  15. static sf::Image invalid_image;
  16. static Tile invalid_tile;
  17. static void initInvalid();
  18. };
  19. }