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.

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "common.h"
  3. #include "Player.h"
  4. #include "Tile.h"
  5. #include "WorldPlane.h"
  6. #include "WorldPlane.h"
  7. #include "Tile.h"
  8. namespace Swan {
  9. class World {
  10. public:
  11. Player *player_;
  12. WorldPlane::PlaneID current_plane_;
  13. std::vector<WorldPlane> planes_;
  14. TileMap tile_map_;
  15. WorldPlane::PlaneID addPlane();
  16. void setCurrentPlane(WorldPlane::PlaneID id) { current_plane_ = id; }
  17. WorldPlane &getPlane(WorldPlane::PlaneID id) { return planes_[id]; }
  18. Tile::TileID getTileID(const std::string &name) {
  19. return tile_map_.getID(name);
  20. }
  21. void registerTile(Tile *t) {
  22. tile_map_.registerTile(t);
  23. }
  24. void draw(Win &win);
  25. void update(float dt);
  26. void tick();
  27. };
  28. }