• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

granatier

Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Bomb Class Reference

#include <bomb.h>

Inheritance diagram for Bomb:
Inheritance graph
[legend]

Public Slots

void detonate ()
 
void slot_detonationCompleted ()
 
void updateMortarState ()
 

Signals

void bombDetonated (Bomb *bomb)
 
void falling ()
 
void mortar (int nMortarState, int nMortarRampEnd, int nMortarPeak, int nMortarGround)
 
void releaseBombArmory ()
 
- Signals inherited from Element
void moved (qreal p_x, qreal p_y)
 

Public Member Functions

 Bomb (qreal fX, qreal fY, Arena *p_arena, int nBombID, int nDetonationCountdown)
 
 ~Bomb ()
 
int bombPower ()
 
int explosionID ()
 
qreal getSpeed ()
 
qreal getXSpeed () const
 
qreal getYSpeed () const
 
void goDown ()
 
void goLeft ()
 
void goRight ()
 
void goUp ()
 
void initDetonation (int nBombID, int nDetonationTimeout)
 
bool isDetonated ()
 
void move (qreal x, qreal y)
 
void pause ()
 
void resume ()
 
void setBombPower (int bombPower)
 
void setKicked (int nDirection)
 
void setThrown (int nDirection)
 
void setXSpeed (qreal p_xSpeed)
 
void setYSpeed (qreal p_ySpeed)
 
void updateMove ()
 
- Public Member Functions inherited from Element
 Element (qreal p_x, qreal p_y, Arena *p_arena)
 
 ~Element ()
 
virtual void doActionOnCollision (Player *p_player)
 
QString getImageId () const
 
Granatier::Element::Type getType () const
 
qreal getX () const
 
qreal getY () const
 
void initCoordinate ()
 
void setArena (Arena *p_arena)
 
void setImageId (const QString &p_imageId)
 
void setInitialCoordinates (qreal p_x, qreal p_y)
 
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 &regExp) 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
 

Protected Member Functions

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)
 

Protected Attributes

int m_bombID
 
int m_bombPower
 
bool m_detonated
 
QTimer * m_detonationCountdownTimer
 
int m_explosionID
 
bool m_falling
 
int m_mortarState
 
QTimer * m_mortarTimer
 
qreal m_speed
 
bool m_stopOnCenter
 
bool m_thrown
 
qreal m_xSpeed
 
qreal m_ySpeed
 
- Protected Attributes inherited from Element
Arena * m_arena
 
QString m_imageId
 
Granatier::Element::Type m_type
 
qreal m_x
 
qreal m_xInit
 
qreal m_y
 
qreal m_yInit
 

Additional Inherited Members

- 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 Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

This class describes the common characteristics and behaviour of the bomb item.

Definition at line 30 of file bomb.h.

Constructor & Destructor Documentation

Bomb::Bomb ( qreal  fX,
qreal  fY,
Arena *  p_arena,
int  nBombID,
int  nDetonationCountdown 
)

Creates a new Bomb instance.

Parameters
fXthe initial x-coordinate
fYthe initial y-coordinate
p_arenathe Arena the Bomb is on
nBombIDthe unique bomb ID
nDetonationCountdownthe time until detonation

Definition at line 31 of file bomb.cpp.

Bomb::~Bomb ( )

Deletes the Bomb instance.

Definition at line 67 of file bomb.cpp.

Member Function Documentation

void Bomb::bombDetonated ( Bomb *  bomb)
signal

Emitted when the Bomb is exploded.

Parameters
bombthis bomb
int Bomb::bombPower ( )

Power of the bomb.

Returns
the Bomb power

Definition at line 445 of file bomb.cpp.

void Bomb::detonate ( )
slot

Manages the Bomb explosion.

Definition at line 471 of file bomb.cpp.

int Bomb::explosionID ( )
Returns
the explosion ID

Definition at line 488 of file bomb.cpp.

void Bomb::falling ( )
signal

Emitted when the bomb is falling in a hole.

qreal Bomb::getSpeed ( )

Gets the Bomb speed.

Returns
the Bomb speed

Definition at line 328 of file bomb.cpp.

qreal Bomb::getXSpeed ( ) const

Gets the Bomb x-speed value.

Returns
the x-speed value

Definition at line 318 of file bomb.cpp.

qreal Bomb::getYSpeed ( ) const

Gets the Bomb y-speed value.

Returns
the y-speed value

Definition at line 323 of file bomb.cpp.

void Bomb::goDown ( )

Makes the Bomb go down.

Definition at line 77 of file bomb.cpp.

void Bomb::goLeft ( )

Makes the Bomb go to the left.

Definition at line 85 of file bomb.cpp.

void Bomb::goRight ( )

Makes the Bomb go to the right.

Definition at line 81 of file bomb.cpp.

void Bomb::goUp ( )

Makes the Bomb go up.

Definition at line 73 of file bomb.cpp.

void Bomb::initDetonation ( int  nBombID,
int  nDetonationTimeout 
)

sets the explosion ID and detonation countdown

Parameters
nBombIDthe Bomb ID that causes the detonation
nDetonationTimeoutthe new detonation timeout

Definition at line 493 of file bomb.cpp.

bool Bomb::isDetonated ( )
Returns
state if the bomb is already detonated

Definition at line 483 of file bomb.cpp.

void Bomb::mortar ( int  nMortarState,
int  nMortarRampEnd,
int  nMortarPeak,
int  nMortarGround 
)
signal

Emitted when the Bomb is thrown by the mortar or by the player.

Parameters
nStatethe current state of the mortar
void Bomb::move ( qreal  x,
qreal  y 
)

Moves the Bomb function of its current coordinates and speed.

If the Bomb reaches a border, it circles around the arena and continue its way from the other side.

Definition at line 310 of file bomb.cpp.

void Bomb::moveOnCenter ( )
protected

Moves the Bomb on the center of its current Cell.

Definition at line 439 of file bomb.cpp.

bool Bomb::onCenter ( )
protected

Checks the Bomb gets on a Cell center during its next movement.

Returns
true if the Bomb is on a Cell center, false otherwise

Definition at line 407 of file bomb.cpp.

void Bomb::pause ( )

Pauses bomb timer.

Definition at line 455 of file bomb.cpp.

void Bomb::releaseBombArmory ( )
signal

Emitted to refill the player bomb armory.

void Bomb::resume ( )

Resumes bomb timer.

Definition at line 463 of file bomb.cpp.

void Bomb::setBombPower ( int  bombPower)

Sets the Power of the bomb.

Parameters
bombPowerthe Bomb power

Definition at line 450 of file bomb.cpp.

void Bomb::setKicked ( int  nDirection)

The direction to move.

Parameters
nDirectiondirection

Definition at line 384 of file bomb.cpp.

void Bomb::setThrown ( int  nDirection)

The direction to throw.

Parameters
nDirectiondirection

Definition at line 343 of file bomb.cpp.

void Bomb::setXSpeed ( qreal  p_xSpeed)

Set the Bomb x-speed value.

Parameters
p_xSpeedthe x-speed to set

Definition at line 333 of file bomb.cpp.

void Bomb::setYSpeed ( qreal  p_ySpeed)

Set the Bomb y-speed value.

Parameters
p_ySpeedthe y-speed to set

Definition at line 338 of file bomb.cpp.

void Bomb::slot_detonationCompleted ( )
slot

Definition at line 516 of file bomb.cpp.

void Bomb::updateMortarState ( )
slot

Definition at line 522 of file bomb.cpp.

void Bomb::updateMove ( )

Updates the Bomb move.

Definition at line 89 of file bomb.cpp.

Member Data Documentation

int Bomb::m_bombID
protected

The Bomb ID.

Definition at line 53 of file bomb.h.

int Bomb::m_bombPower
protected

The Bomb detonation power.

Definition at line 50 of file bomb.h.

bool Bomb::m_detonated
protected

The Bomb detonation has already started.

Definition at line 47 of file bomb.h.

QTimer* Bomb::m_detonationCountdownTimer
protected

Timer used to make the bomb detonate.

Definition at line 59 of file bomb.h.

int Bomb::m_explosionID
protected

The ID of the Bomb that causes the explosion.

Definition at line 56 of file bomb.h.

bool Bomb::m_falling
protected

Definition at line 69 of file bomb.h.

int Bomb::m_mortarState
protected

Definition at line 64 of file bomb.h.

QTimer* Bomb::m_mortarTimer
protected

Timer used for the throw bonus and mortar.

Definition at line 62 of file bomb.h.

qreal Bomb::m_speed
protected

The Bomb speed.

Definition at line 44 of file bomb.h.

bool Bomb::m_stopOnCenter
protected

Definition at line 67 of file bomb.h.

bool Bomb::m_thrown
protected

Definition at line 66 of file bomb.h.

qreal Bomb::m_xSpeed
protected

The Bomb x-speed.

Definition at line 38 of file bomb.h.

qreal Bomb::m_ySpeed
protected

The Bomb y-speed.

Definition at line 41 of file bomb.h.


The documentation for this class was generated from the following files:
  • bomb.h
  • bomb.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

granatier

Skip menu "granatier"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal