kapman
#include <kapman.h>

Signals | |
| void | directionChanged () |
| void | gameUpdated () |
| void | stopped () |
| void | sWinPoints (Element *p_element) |
Signals inherited from Character | |
| void | eaten () |
Signals inherited from Element | |
| void | moved (qreal p_x, qreal p_y) |
Public Member Functions | |
| Kapman (qreal p_x, qreal p_y, Maze *p_maze) | |
| ~Kapman () | |
| void | die () |
| void | emitGameUpdated () |
| qreal | getAskedXSpeed () const |
| qreal | getAskedYSpeed () const |
| void | goDown () |
| void | goLeft () |
| void | goRight () |
| void | goUp () |
| void | init () |
| void | initSpeedInc () |
| void | updateMove () |
| void | winPoints (Element *p_element) |
Public Member Functions inherited from Character | |
| Character (qreal p_x, qreal p_y, Maze *p_maze) | |
| ~Character () | |
| void | die () |
| qreal | getNormalSpeed () const |
| qreal | getSpeed () const |
| qreal | getXSpeed () const |
| qreal | getYSpeed () const |
| void | increaseCharactersSpeed () |
| void | initSpeed () |
| bool | isInLineSight (Character *p_character) |
| void | move () |
| void | setXSpeed (qreal p_xSpeed) |
| void | setYSpeed (qreal p_ySpeed) |
Public Member Functions inherited from Element | |
| Element (qreal p_x, qreal p_y, Maze *p_maze) | |
| ~Element () | |
| virtual void | doActionOnCollision (Kapman *p_kapman) |
| QString | getImageId () const |
| int | getPoints () const |
| Element::Type | getType () const |
| qreal | getX () const |
| qreal | getY () const |
| void | initCoordinate () |
| void | setImageId (const QString &p_imageId) |
| void | setX (qreal p_x) |
| void | setY (qreal p_y) |
Public Member Functions inherited from QObject | |
| QObject (QObject *parent) | |
| QObject (QObject *parent, const char *name) | |
| virtual | ~QObject () |
| bool | blockSignals (bool block) |
| QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
| const QObjectList & | children () const |
| const char * | className () const |
| bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
| void | deleteLater () |
| void | destroyed (QObject *obj) |
| bool | disconnect (const QObject *receiver, const char *method) |
| bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
| void | dumpObjectInfo () |
| void | dumpObjectTree () |
| QList< QByteArray > | dynamicPropertyNames () const |
| virtual bool | event (QEvent *e) |
| virtual bool | eventFilter (QObject *watched, QEvent *event) |
| T | findChild (const QString &name) const |
| QList< T > | findChildren (const QRegExp ®Exp) const |
| QList< T > | findChildren (const QString &name) const |
| bool | inherits (const char *className) const |
| void | insertChild (QObject *object) |
| void | installEventFilter (QObject *filterObj) |
| bool | isA (const char *className) const |
| bool | isWidgetType () const |
| void | killTimer (int id) |
| virtual const QMetaObject * | metaObject () const |
| void | moveToThread (QThread *targetThread) |
| const char * | name () const |
| const char * | name (const char *defaultName) const |
| QString | objectName () const |
| QObject * | parent () const |
| QVariant | property (const char *name) const |
| void | removeChild (QObject *object) |
| void | removeEventFilter (QObject *obj) |
| void | setName (const char *name) |
| void | setObjectName (const QString &name) |
| void | setParent (QObject *parent) |
| bool | setProperty (const char *name, const QVariant &value) |
| bool | signalsBlocked () const |
| int | startTimer (int interval) |
| QThread * | thread () const |
Additional Inherited Members | |
Public Types inherited from Element | |
| enum | Type { KAPMAN = 0, GHOST = 1, PILL = 2, ENERGYZER = 3, BONUS = 4 } |
Static Public Member Functions inherited from QObject | |
| bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
| bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
| bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
| bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
| QString | tr (const char *sourceText, const char *disambiguation, int n) |
| QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Static Public Attributes inherited from Character | |
| static const qreal | HIGH_SPEED = 5.25 |
| static const qreal | HIGH_SPEED_INC = 0.02 |
| static const qreal | LOW_SPEED = 3.75 |
| static const qreal | LOW_SPEED_INC = 0.005 |
| static const qreal | MEDIUM_SPEED = 4.5 |
| static const qreal | MEDIUM_SPEED_INC = 0.01 |
Protected Member Functions inherited from Character | |
| Cell | getNextCell () |
| void | moveOnCenter () |
| bool | onCenter () |
Protected Member Functions inherited from QObject | |
| bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
| virtual void | childEvent (QChildEvent *event) |
| virtual void | connectNotify (const char *signal) |
| virtual void | customEvent (QEvent *event) |
| virtual void | disconnectNotify (const char *signal) |
| int | receivers (const char *signal) const |
| QObject * | sender () const |
| int | senderSignalIndex () const |
| virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
| QByteArray | normalizeSignalSlot (const char *signalSlot) |
Protected Attributes inherited from Character | |
| qreal | m_maxSpeed |
| qreal | m_normalSpeed |
| qreal | m_speed |
| qreal | m_speedIncrease |
| qreal | m_xSpeed |
| qreal | m_ySpeed |
Protected Attributes inherited from Element | |
| QString | m_imageId |
| Maze * | m_maze |
| int | m_points |
| Type | m_type |
| qreal | m_x |
| qreal | m_xInit |
| qreal | m_y |
| qreal | m_yInit |
Properties inherited from QObject | |
| objectName | |
Detailed Description
Constructor & Destructor Documentation
| Kapman::Kapman | ( | qreal | p_x, |
| qreal | p_y, | ||
| Maze * | p_maze | ||
| ) |
Creates a new Kapman instance.
Definition at line 25 of file kapman.cpp.
| Kapman::~Kapman | ( | ) |
Deletes the Kapman instance.
Definition at line 30 of file kapman.cpp.
Member Function Documentation
| void Kapman::die | ( | ) |
Implements the Character function.
Definition at line 140 of file kapman.cpp.
|
signal |
Emitted when the direction changed.
| void Kapman::emitGameUpdated | ( | ) |
Emits a signal to Kapmanitem in order to manage collisions.
Definition at line 144 of file kapman.cpp.
|
signal |
Signals to Kapmanitem that the game has been updated.
| qreal Kapman::getAskedXSpeed | ( | ) | const |
- Returns
- the asked x speed value
Definition at line 148 of file kapman.cpp.
| qreal Kapman::getAskedYSpeed | ( | ) | const |
- Returns
- the asked y speed value
Definition at line 152 of file kapman.cpp.
|
virtual |
|
virtual |
Makes the Kapman ask to go to the left.
Implements Character.
Definition at line 56 of file kapman.cpp.
|
virtual |
Makes the Kapman ask to go to the right.
Implements Character.
Definition at line 51 of file kapman.cpp.
|
virtual |
| void Kapman::init | ( | ) |
Initializes the Kapman.
Definition at line 34 of file kapman.cpp.
|
virtual |
Initializes the Kapman speed from the Character speed.
Implements Character.
Definition at line 184 of file kapman.cpp.
|
signal |
Emitted when the kapman stops moving.
|
signal |
Signals to the game that the kapman win points.
- Parameters
-
p_element reference to the element eaten
|
virtual |
| void Kapman::winPoints | ( | Element * | p_element | ) |
Manages the points won.
- Parameters
-
p_element reference to the element eaten
Definition at line 135 of file kapman.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:16 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
KDE API Reference
Signals inherited from