1 #ifndef BLOBS_CREATURE_CREATURE_HPP_
2 #define BLOBS_CREATURE_CREATURE_HPP_
6 #include "Situation.hpp"
7 #include "Steering.hpp"
8 #include "../graphics/glm.hpp"
9 #include "../graphics/SimpleVAO.hpp"
35 Creature(const Creature &) = delete;
36 Creature &operator =(const Creature &) = delete;
38 Creature(Creature &&) = delete;
39 Creature &operator =(Creature &&) = delete;
42 void Name(const std::string &n) noexcept { name = n; }
43 const std::string &Name() const noexcept { return name; }
45 void Health(double h) noexcept { health = h; }
46 double Health() const noexcept { return health; }
47 void Hurt(double d) noexcept;
49 void AddNeed(std::unique_ptr<Need> &&n) { needs.emplace_back(std::move(n)); }
50 const std::vector<std::unique_ptr<Need>> &Needs() const noexcept { return needs; }
52 void AddGoal(std::unique_ptr<Goal> &&);
53 const std::vector<std::unique_ptr<Goal>> &Goals() const noexcept { return goals; }
57 Situation &GetSituation() noexcept { return situation; }
58 const Situation &GetSituation() const noexcept { return situation; }
60 Steering &GetSteering() noexcept { return steering; }
61 const Steering &GetSteering() const noexcept { return steering; }
63 void Velocity(const glm::dvec3 &v) noexcept { vel = v; }
64 const glm::dvec3 &Velocity() const noexcept { return vel; }
66 glm::dmat4 LocalTransform() noexcept;
69 void Draw(app::Assets &, graphics::Viewport &);
75 std::vector<std::unique_ptr<Need>> needs;
76 std::vector<std::unique_ptr<Goal>> goals;
88 graphics::SimpleVAO<Attributes, unsigned short> vao;
92 /// put creature on planet and configure it to (hopefully) survive
93 void Spawn(Creature &, world::Planet &, app::Assets &);