TinyWorld.h 840 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // Created by jovian on 18/07/17.
  3. //
  4. #ifndef TINYSHOOTER_TINYWORLD_H
  5. #define TINYSHOOTER_TINYWORLD_H
  6. #include <box2d/box2d.h>
  7. #include <list>
  8. #include "../Graphics/Visual.h"
  9. #include "Entity.h"
  10. class TinyWorld : public b2World {
  11. public:
  12. TinyWorld(const b2Vec2 &gravity);
  13. // Build a procedural world
  14. void createProceduralWorld();
  15. // Add entity in physic world
  16. void addEntity(Entity *newcomer);
  17. // Delete every entity, be careful with your pointers !!!
  18. void clearEveryEntity();
  19. // Update every entity and make a cleanup : be careful with pointers !
  20. void updateAll();
  21. // Detect visuals in desired area
  22. void collectVisuals(std::vector<Visual*> &scope, b2Vec2 center, b2Vec2 diago);
  23. protected:
  24. std::list<Entity*> m_entities; // Store every entity
  25. };
  26. #endif //TINYSHOOTER_TINYWORLD_H