X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FEntity.h;h=be3197d9da4010fa6e9fc2100171c3e3d44a2f62;hb=a3ba4dc677ad7c92eeb78b20b642241563605c9d;hp=a6c4201763df75c161c3a88604398230efaf663a;hpb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;p=l2e.git diff --git a/src/map/Entity.h b/src/map/Entity.h index a6c4201..be3197d 100644 --- a/src/map/Entity.h +++ b/src/map/Entity.h @@ -3,7 +3,7 @@ #include "../battle/fwd.h" #include "../battle/Monster.h" -#include "../geometry/Vector.h" +#include "../math/Vector.h" #include "../graphics/fwd.h" #include "../graphics/Animation.h" @@ -38,20 +38,20 @@ public: public: /// Pixel resolved position of the entity's top left corner on the map. - geometry::Vector &Position() { return position; } - const geometry::Vector &Position() const { return position; } + math::Vector &Position() { return position; } + const math::Vector &Position() const { return position; } /// Velocity of the entity in pixels per second. - geometry::Vector &Velocity() { return velocity; } - const geometry::Vector &Velocity() const { return velocity; } + math::Vector &Velocity() { return velocity; } + const math::Vector &Velocity() const { return velocity; } /// Offset of the entity's sprite's to left corner relative to Position(). - geometry::Vector &SpriteOffset() { return spriteOffset; } - const geometry::Vector &SpriteOffset() const { return spriteOffset; } + math::Vector &SpriteOffset() { return spriteOffset; } + const math::Vector &SpriteOffset() const { return spriteOffset; } /// Reset the entity to the stored tile coordinates (usually set when /// loading game data). - void ResetPosition(const geometry::Vector &tileSize) { position = tilePosition * tileSize; } + void ResetPosition(const math::Vector &tileSize) { position = tilePosition * tileSize; } /// Set the animation to use for animated entities. /// For orientable entities, the animation should have north, south, east, @@ -110,9 +110,9 @@ public: /// Add monsters. This will cause the entity to be Hostile() and result in a /// battle scene with given monsters when touched. - void SetMonsters(battle::Monster *m, int num) { monsters = m; numMonsters = num; } - battle::Monster *MonstersBegin() { return monsters; } - battle::Monster *MonstersEnd() { return monsters + numMonsters; } + void SetMonsters(battle::Monster **m, int num) { monsters = m; numMonsters = num; } + battle::Monster **MonstersBegin() { return monsters; } + battle::Monster **MonstersEnd() { return monsters + numMonsters; } /// Get an entity that should follow in this one's steps or 0 if none. Entity *Follower() { return follower; } @@ -124,12 +124,12 @@ public: void RemoveFollower(Entity *); /// Check if position locks into grid defined by given tileSize. - bool TileLock(const geometry::Vector &tileSize) const; + bool TileLock(const math::Vector &tileSize) const; /// Integrate this entity's physical properties over given time interval. void Update(float deltaT); - void Render(SDL_Surface *, const geometry::Vector &offset) const; + void Render(SDL_Surface *, const math::Vector &offset) const; static void CreateTypeDescription(); static void Construct(void *); @@ -143,13 +143,13 @@ private: const graphics::Animation *animation; const graphics::Sprite *sprite; battle::PartyLayout *partyLayout; - battle::Monster *monsters; + battle::Monster **monsters; int numMonsters; graphics::AnimationRunner runner; - geometry::Vector spriteOffset; - geometry::Vector tilePosition; - geometry::Vector position; - geometry::Vector velocity; + math::Vector spriteOffset; + math::Vector tilePosition; + math::Vector position; + math::Vector velocity; Orientation orientation; float speed; int flags;