#define BLOBS_CREATURE_CREATURE_HPP_
#include "Need.hpp"
+#include "Situation.hpp"
#include "../graphics/glm.hpp"
#include "../graphics/SimpleVAO.hpp"
+#include <memory>
#include <string>
#include <vector>
Creature &operator =(Creature &&) = delete;
public:
- void SetBody(world::Body &b) noexcept { body = &b; }
- world::Body &GetBody() noexcept { return *body; }
- const world::Body &GetBody() const noexcept { return *body; }
-
- void Surface(int s) noexcept { surface = s; }
- void Position(const glm::dvec3 &p) noexcept { position = p; }
-
void Name(const std::string &n) noexcept { name = n; }
const std::string &Name() const noexcept { return name; }
void Health(double h) noexcept { health = h; }
double Health() const noexcept { return health; }
+ void Hurt(double d) noexcept;
- void AddNeed(const Need &n) { needs.push_back(n); }
+ void AddNeed(std::unique_ptr<Need> &&n) { needs.emplace_back(std::move(n)); }
+ const std::vector<std::unique_ptr<Need>> &Needs() const noexcept { return needs; }
void Tick(double dt);
+ Situation &GetSituation() noexcept { return situation; }
+ const Situation &GetSituation() const noexcept { return situation; }
+
glm::dmat4 LocalTransform() noexcept;
void BuildVAO();
void Draw(app::Assets &, graphics::Viewport &);
private:
- world::Body *body;
- int surface;
- glm::dvec3 position;
-
std::string name;
double health;
- std::vector<Need> needs;
+ std::vector<std::unique_ptr<Need>> needs;
+
+ Situation situation;
struct Attributes {
glm::vec3 position;