Universe.h 832 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // Created by jovian on 17/08/17.
  3. //
  4. #ifndef SPACEEXPANSION_UNIVERSE_H
  5. #define SPACEEXPANSION_UNIVERSE_H
  6. #include <set>
  7. #include <vector>
  8. #include "Planet.h"
  9. #include "StarShip.h"
  10. #include "../Rules/PlanetStep.h"
  11. class Universe {
  12. // Methods
  13. public:
  14. Universe();
  15. ~Universe();
  16. void collectVisuals(std::vector<Visual *> &scope);
  17. void update(); // Call update for each ship and each planet
  18. void routeShips(); // Move ships between space and planets
  19. void createRandomUniverse();
  20. void addRule(PlanetStep *rule);
  21. const PlanetDef getNearestPlanetInfo(b2Vec2 from);
  22. // Attributes
  23. private:
  24. std::vector<Planet *> m_planets;
  25. std::vector<StarShip *> m_ships;
  26. std::set<StarShip *> m_travellingShips;
  27. std::vector<PlanetStep *> m_rules;
  28. };
  29. #endif //SPACEEXPANSION_UNIVERSE_H