World.h 656 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <vector>
  3. #include "HeightMap.h"
  4. #include "Player.h"
  5. #include "Enemy.h"
  6. #include "LevelObject.h"
  7. #include "Interface.h"
  8. class Entity;
  9. class World
  10. {
  11. private:
  12. std::vector<std::pair<int, std::pair<std::string, bool>>> objecttemplates;
  13. Player* player;
  14. HeightMap* heightmap;
  15. Interface* interface;
  16. std::vector<Entity*> entities;
  17. std::vector<Enemy*> enemies;
  18. public:
  19. World(const std::string &fileName);
  20. ~World();
  21. void draw();
  22. void update(float elapsedTime);
  23. bool isPlayerPositionValid();
  24. float getHeight(float x, float y);
  25. void addLevelObject(LevelObject* obj);
  26. std::pair<std::string, bool> getObjectFromValue(int i);
  27. };