#ifndef ACTOR_H #define ACTOR_H #include "pixmapitem.h" #include "constants.h" #include "audio.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 color(); PixmapItem &icon(); Movement direction(); bool isLocal(); void move(Movement direction); bool isMoving(); void die(); void eatingCherry(); unsigned int getRoundPoints(); unsigned int getGamePoints(); void addRoundPoints(unsigned int amount); void finishRound(); private: void moveByServer(Movement direction); private: QPixmap m_pix; Color::Color m_color; Movement m_direction; PixmapItem m_icon; bool m_local; AudioPlayer *m_player; unsigned int m_roundPoints; unsigned int m_gamePoints; QList m_images; QList m_eating; QParallelAnimationGroup *m_moving; }; #endif // ACTOR_H