From 85b09864f6d489e8c998e9f172d25079d572c602 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 18 Apr 2011 19:47:34 +0200 Subject: - add actor.canEat(other) to check if actor can eat other (note: that doesn't mean that other can eat actor!!) - server now generated and sends the colorlist to the server in the first map update packet - add a better AI --- pacman-c++/sceneholder.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pacman-c++/sceneholder.h') diff --git a/pacman-c++/sceneholder.h b/pacman-c++/sceneholder.h index 418f16b..69ee598 100644 --- a/pacman-c++/sceneholder.h +++ b/pacman-c++/sceneholder.h @@ -21,6 +21,8 @@ public: void updateMap(const Transmission::map_t& map, const unsigned int x, const unsigned int y); void setColor(Color::Color color = Color::none); Color::Color color(); + void setEatingOrder(QList &order); + QList &eatingOrder(); private slots: void decrementPoints(); @@ -46,6 +48,13 @@ protected: /* my local color */ Color::Color m_color; + /* a actor can only eat his upper neighbour + * the order of the neighbours is determined by the colors order (sent from server) + * please note that !pl1.canEat(pl2, ...) doesn't necessarily mean that pl2 can eat pl1 + * order MUST be in this format: [col1, [col2, ..., colN], col1] + */ + QList m_eatingorder; + /* points left before round ends */ unsigned int m_pointsLeft; }; -- cgit v1.2.3