X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FEntity.h;h=3ddc9ccef49f5340680882be332ae216cbb1c259;hb=d2d8ff1fd5f55e8b43d48ae5e75c216492e2f032;hp=12f22c947aae0c903a2468382c0261217ae76456;hpb=0fc36d261ef8129debbd4aa15594bc46cb82eb27;p=l2e.git diff --git a/src/map/Entity.h b/src/map/Entity.h index 12f22c9..3ddc9cc 100644 --- a/src/map/Entity.h +++ b/src/map/Entity.h @@ -30,6 +30,9 @@ public: ORIENTATION_SOUTH = 2, ORIENTATION_WEST = 3, }; + enum Flags { + FLAG_NONBLOCKING = 0x01, + }; public: geometry::Vector &Position() { return position; } @@ -38,8 +41,8 @@ public: geometry::Vector &Velocity() { return velocity; } const geometry::Vector &Velocity() const { return velocity; } - geometry::Vector &SpriteOffset() { return spriteOffset; } - const geometry::Vector &SpriteOffset() const { return spriteOffset; } + geometry::Vector &SpriteOffset() { return spriteOffset; } + const geometry::Vector &SpriteOffset() const { return spriteOffset; } void SetAnimation(const graphics::Animation *a); void StartAnimation(app::Application &ctrl); @@ -51,6 +54,13 @@ public: Orientation GetOrientation() const { return orientation; } void SetSpeed(float); + 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(); + } + Entity *Follower() { return follower; } const Entity *Follower() const { return follower; } void AddFollower(Entity *); @@ -62,6 +72,10 @@ public: void Render(SDL_Surface *, const geometry::Vector &offset) const; + static void CreateTypeDescription(); + static void Construct(void *); + static void Load(void *); + private: void UpdateVelocity(); @@ -69,11 +83,12 @@ private: Entity *follower; const graphics::Animation *animation; graphics::AnimationRunner runner; - geometry::Vector spriteOffset; + geometry::Vector spriteOffset; geometry::Vector position; geometry::Vector velocity; Orientation orientation; float speed; + int flags; };