World.h 671 B

1234567891011121314151617181920212223242526272829303132333435
  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. int music_id;
  17. std::vector<Entity*> entities;
  18. std::vector<Enemy*> enemies;
  19. public:
  20. World(const std::string &fileName);
  21. ~World();
  22. void draw();
  23. void update(float elapsedTime);
  24. bool isPlayerPositionValid();
  25. float getHeight(float x, float y);
  26. void addLevelObject(LevelObject* obj);
  27. std::pair<std::string, bool> getObjectFromValue(int i);
  28. };