boat.h Example File
animation/sub-attaq/boat.h
#ifndef __BOAT__H__
#define __BOAT__H__
#include "pixmapitem.h"
class Bomb;
class QVariantAnimation;
class QAbstractAnimation;
class QStateMachine;
class Boat : public PixmapItem
{
Q_OBJECT
public:
enum Movement {
None = 0,
Left,
Right
};
enum { Type = UserType + 2 };
Boat();
void destroy();
void run();
void stop();
int bombsLaunched() const;
void setBombsLaunched(int number);
int currentSpeed() const;
void setCurrentSpeed(int speed);
enum Movement currentDirection() const;
void setCurrentDirection(Movement direction);
void updateBoatMovement();
int type() const override;
signals:
void boatDestroyed();
void boatExecutionFinished();
private:
int speed;
int bombsAlreadyLaunched;
Movement direction;
QVariantAnimation *movementAnimation;
QAbstractAnimation *destroyAnimation;
QStateMachine *machine;
};
#endif //__BOAT__H__