#ifndef ACTOR_H #define ACTOR_H #include "pixmapitem.h" #include "constants.h" #include #include #include class Actor : public PixmapItem { Q_OBJECT public: enum Movement { None = 0, Left, Right, Up, Down, }; Actor(Color::Color color, bool local = false, QGraphicsItem *parent = 0); virtual ~Actor() {}; QSequentialAnimationGroup *setupEatingAnimation(Actor::Movement direction); Color::Color getColor(); PixmapItem &getIcon(); bool isLocal(); void move(Movement direction); bool isMoving(); void die(); void eatingCherry(); unsigned int getRoundPoints() { return m_roundPoints; } unsigned int getGamePoints() { return m_gamePoints; } void addRoundPoints(unsigned int amount) { m_roundPoints += amount; } void finishRound() { m_gamePoints += m_roundPoints; m_roundPoints = 0; } private slots: void enqueue(); private: QPixmap m_pix; Color::Color m_color; Movement m_direction; PixmapItem m_icon; bool m_local; unsigned int m_roundPoints, m_gamePoints; QList m_images; QList m_eating; QParallelAnimationGroup *m_moving; }; #endif // ACTOR_H