World.h 576 B

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