namespace world {
class Body;
class Planet;
+ class Simulation;
}
namespace creature {
class Creature {
public:
- Creature();
+ explicit Creature(world::Simulation &);
~Creature();
Creature(const Creature &) = delete;
Creature &operator =(Creature &&) = delete;
public:
+ world::Simulation &GetSimulation() noexcept { return sim; }
+ const world::Simulation &GetSimulation() const noexcept { return sim; }
+
void Name(const std::string &n) noexcept { name = n; }
const std::string &Name() const noexcept { return name; }
+ void Size(double s) noexcept { size = s; }
+ double Size() const noexcept { return size; }
+
void Health(double h) noexcept { health = h; }
double Health() const noexcept { return health; }
void Hurt(double d) noexcept;
void Velocity(const glm::dvec3 &v) noexcept { vel = v; }
const glm::dvec3 &Velocity() const noexcept { return vel; }
+ bool Moving() const noexcept { return !allzero(vel); }
glm::dmat4 LocalTransform() noexcept;
void Draw(app::Assets &, graphics::Viewport &);
private:
+ world::Simulation ∼
std::string name;
+ double size;
double health;
std::vector<std::unique_ptr<Need>> needs;