diff options
Diffstat (limited to 'src/game/base/patrol.h')
-rw-r--r-- | src/game/base/patrol.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/game/base/patrol.h b/src/game/base/patrol.h index 3e15d3d..a747a89 100644 --- a/src/game/base/patrol.h +++ b/src/game/base/patrol.h @@ -25,6 +25,9 @@ namespace game class Patrol: public core::Entity { public: + + /* --- WayPoint -------------------------------------------- */ + /** * @brief a node in the patrol's travel path * */ @@ -67,15 +70,27 @@ public: bool waypoint_dock; }; + + /* --- Patrol ---------------------------------------------- */ typedef std::list<WayPoint *> WayPoints; + + typedef std::list<NPC *> Members; Patrol(); virtual ~Patrol(); inline const NPC::Profile profile() const { return patrol_profile; - } + } + + inline WayPoint * waypoint() { + if (patrol_waypoint_current == patrol_waypoints.end()) { + return 0; + } else { + return (*patrol_waypoint_current); + } + } void set_profile(const NPC::Profile profile); @@ -84,11 +99,23 @@ public: virtual void validate(); virtual void frame(const unsigned long elapsed); + + void add_member(NPC *npc); + + void erase_member(NPC *npc); private: + void set_leader(); + WayPoints patrol_waypoints; + WayPoints::iterator patrol_waypoint_current; + + Members patrol_members; + NPC::Profile patrol_profile; + + NPC *patrol_leader; }; } // namespace game |