12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // Created by jovian on 17/08/17.
- //
- #ifndef SPACEEXPANSION_PLANET_H
- #define SPACEEXPANSION_PLANET_H
- #include <string>
- #include "../Graphics/Visual.h"
- #include "../Rules/PlanetStep.h"
- #include "StarShip.h"
- class Planet {
- // Methods
- public:
- Planet(const PlanetDef &def);
- virtual ~Planet();
- Visual *makeVisual();
- void applyRule(PlanetStep *rule);
- const PlanetDef &getDef() const;
- int getId() const;
- void landShip(StarShip *ship); // If a ship is arrived it can land on the planet
- bool readyShip(); // Return true if at least one ship is ready to go
- StarShip* launchShip(const Stock &avg); // Load and launch a ship into space
- bool need(Resource res, Stock average); // Return true if this lanet need res
- static std::string randomName();
- // Attributes
- private:
- PlanetDef m_def;
- int m_idPlanet;
- unsigned int m_imgId;
- float m_angle;
- std::vector<StarShip *> m_landedShips;
- // Static
- private:
- static int m_incr; // Useful for indexing
- };
- #endif //SPACEEXPANSION_PLANET_H
|