]> git.localhorst.tv Git - blobs.git/blobdiff - src/creature/Creature.hpp
extract situation from creature
[blobs.git] / src / creature / Creature.hpp
index 135cf9eb1d98d80d70a327f38a66e106d42af679..f4c000408a63fa9f5bee40af3927f34b92403230 100644 (file)
@@ -2,6 +2,7 @@
 #define BLOBS_CREATURE_CREATURE_HPP_
 
 #include "Need.hpp"
+#include "Situation.hpp"
 #include "../graphics/glm.hpp"
 #include "../graphics/SimpleVAO.hpp"
 
@@ -35,13 +36,6 @@ public:
        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; }
 
@@ -53,20 +47,21 @@ public:
 
        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;
 
+       Situation situation;
+
        struct Attributes {
                glm::vec3 position;
                glm::vec3 normal;