]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Entity.h
closed the gap between battle and map state (yay)
[l2e.git] / src / map / Entity.h
index 3ddc9ccef49f5340680882be332ae216cbb1c259..13ecacac627eb021ee9f35ede96db8b739e6ea8f 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef MAP_ENTITY_H_
 #define MAP_ENTITY_H_
 
+#include "../battle/fwd.h"
+#include "../battle/Monster.h"
 #include "../geometry/Vector.h"
 #include "../graphics/fwd.h"
 #include "../graphics/Animation.h"
@@ -56,10 +58,14 @@ public:
 
        void SetFlags(int f) { flags = f; }
        bool Blocking() const { return !(flags & FLAG_NONBLOCKING); }
-       bool Hostile() const {
-               // NOTE: this is a stub for testing!
-               return Blocking();
-       }
+       bool Hostile() const { return partyLayout && numMonsters > 0; }
+
+       void SetPartyLayout(battle::PartyLayout *l) { partyLayout = l; }
+       battle::PartyLayout *PartyLayout() { return partyLayout; }
+
+       void SetMonsters(battle::Monster *m, int num) { monsters = m; numMonsters = num; }
+       battle::Monster *MonstersBegin() { return monsters; }
+       battle::Monster *MonstersEnd() { return monsters + numMonsters; }
 
        Entity *Follower() { return follower; }
        const Entity *Follower() const { return follower; }
@@ -82,6 +88,9 @@ private:
 private:
        Entity *follower;
        const graphics::Animation *animation;
+       battle::PartyLayout *partyLayout;
+       battle::Monster *monsters;
+       int numMonsters;
        graphics::AnimationRunner runner;
        geometry::Vector<int> spriteOffset;
        geometry::Vector<float> position;