X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FEntity.h;h=fc1dc812194d5332e415e37501a35b90bc690301;hb=77915e0186f4fc0788054eb34651c726b80d981c;hp=3ddc9ccef49f5340680882be332ae216cbb1c259;hpb=d2d8ff1fd5f55e8b43d48ae5e75c216492e2f032;p=l2e.git diff --git a/src/map/Entity.h b/src/map/Entity.h index 3ddc9cc..fc1dc81 100644 --- a/src/map/Entity.h +++ b/src/map/Entity.h @@ -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" @@ -32,6 +34,8 @@ public: }; enum Flags { FLAG_NONBLOCKING = 0x01, + FLAG_PUSHABLE = 0x02, + FLAG_FIXED_ORIENTATION = 0x04, }; public: @@ -50,16 +54,28 @@ public: void StopAnimation(); bool AnimationRunning() const { return runner.Running(); } + void SetSprite(const graphics::Sprite *s) { sprite = s; } + void SetOrientation(Orientation); Orientation GetOrientation() const { return orientation; } void SetSpeed(float); + void SetHandsFree(); + void SetCarrying(); + void SetPushing(); + 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; } + bool Pushable() const { return flags & FLAG_PUSHABLE; } + bool CanTurn() const { return !(flags & FLAG_FIXED_ORIENTATION); } + + 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 +98,10 @@ private: private: Entity *follower; const graphics::Animation *animation; + const graphics::Sprite *sprite; + battle::PartyLayout *partyLayout; + battle::Monster *monsters; + int numMonsters; graphics::AnimationRunner runner; geometry::Vector spriteOffset; geometry::Vector position;