World.h 714 B

12345678910111213141516171819202122232425262728293031323334353637
  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. #include "Crystal.h"
  9. class Entity;
  10. class World
  11. {
  12. private:
  13. std::vector<std::pair<int, std::pair<std::string, bool>>> objecttemplates;
  14. Player* player;
  15. HeightMap* heightmap;
  16. Interface* interface;
  17. std::vector<Entity*> entities;
  18. std::vector<Enemy*> enemies;
  19. //std::vector<Crystal*> crystals;
  20. public:
  21. World(const std::string &fileName);
  22. ~World();
  23. void draw();
  24. void update(float elapsedTime);
  25. bool isPlayerPositionValid();
  26. float getHeight(float x, float y);
  27. void addLevelObject(LevelObject* obj);
  28. std::pair<std::string, bool> getObjectFromValue(int i);
  29. };