World.h 727 B

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