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

granatier

Public Member Functions | List of all members
Arena Class Reference

#include <arena.h>

Inheritance diagram for Arena:
Inheritance graph
[legend]

Public Member Functions

 Arena ()
 
 ~Arena ()
 
void addPlayerPosition (const QPointF &p_position)
 
Cell getCell (const int p_row, const int p_column) const
 
int getColFromX (const qreal p_x) const
 
QPoint getCoords (Cell *p_cell) const
 
QString getName () const
 
int getNbColumns () const
 
int getNbRows () const
 
QPointF getPlayerPosition (int p_player) const
 
int getRowFromY (const qreal p_y) const
 
void init (const int p_nbRows, const int p_nbColumns)
 
void removeCellElement (const int p_row, const int p_column, Element *p_element)
 
void setCellElement (const int p_row, const int p_column, Element *p_element)
 
void setCellType (const int p_row, const int p_column, const Granatier::Cell::Type p_type)
 
void setName (const QString &p_strArenaName)
 
- 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
 

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)
 
- 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)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

This class represents the Arena of the game.

Definition at line 36 of file arena.h.

Constructor & Destructor Documentation

Arena::Arena ( )

Creates a new Arena instance.

Definition at line 27 of file arena.cpp.

Arena::~Arena ( )

Deletes the Arena instance.

Definition at line 31 of file arena.cpp.

Member Function Documentation

void Arena::addPlayerPosition ( const QPointF &  p_position)

Sets a player position on the arena.

Parameters
p_positionthe player position

Definition at line 90 of file arena.cpp.

Cell Arena::getCell ( const int  p_row,
const int  p_column 
) const

Gets the Cell at the given coordinates.

Parameters
p_rowthe row index
p_columnthe column index
Returns
the Cell at the given row and column

Definition at line 120 of file arena.cpp.

int Arena::getColFromX ( const qreal  p_x) const

Gets the column index corresponding to the given x-coordinate.

Parameters
p_xthe x-coordinate to convert into column index
Returns
the column index corresponding to the given x-coordinate

Definition at line 154 of file arena.cpp.

QPoint Arena::getCoords ( Cell *  p_cell) const

Gets the coordinates of the given Cell as a QPoint.

Parameters
p_cellthe searched Cell
Returns
the row and column of the given Cell

Definition at line 129 of file arena.cpp.

QString Arena::getName ( ) const

Returns the Arean name.

Returns
the Arena name

Definition at line 53 of file arena.cpp.

int Arena::getNbColumns ( ) const

Gets the number of columns of the Arena.

Returns
the number of columns

Definition at line 164 of file arena.cpp.

int Arena::getNbRows ( ) const

Gets the number of rows of the Arena.

Returns
the number of rows

Definition at line 169 of file arena.cpp.

QPointF Arena::getPlayerPosition ( int  p_player) const

Gets the player position on the arena.

Parameters
p_playerthe player number
Returns
p_position the player position

Definition at line 111 of file arena.cpp.

int Arena::getRowFromY ( const qreal  p_y) const

Gets the row index corresponding to the given y-coordinate.

Parameters
p_ythe y-coordinate to convert into row index
Returns
the row index corresponding to the given y-coordinate

Definition at line 144 of file arena.cpp.

void Arena::init ( const int  p_nbRows,
const int  p_nbColumns 
)

Creates the Arena matrix.

Parameters
p_nbRowsthe number of rows
p_nbColumnsthe number of columns

Definition at line 40 of file arena.cpp.

void Arena::removeCellElement ( const int  p_row,
const int  p_column,
Element *  p_element 
)

Removes the Element that is on the Cell whose coordinates are given in parameters.

Parameters
p_rowthe Cell row
p_columnthe Cell column
p_elementthe Element that is on the Cell

Definition at line 81 of file arena.cpp.

void Arena::setCellElement ( const int  p_row,
const int  p_column,
Element *  p_element 
)

Sets the Element that is on the Cell whose coordinates are given in parameters.

Parameters
p_rowthe Cell row
p_columnthe Cell column
p_elementthe Element that is on the Cell

Definition at line 72 of file arena.cpp.

void Arena::setCellType ( const int  p_row,
const int  p_column,
const Granatier::Cell::Type  p_type 
)

Sets the CellType of the Cell whose coordinates are given in parameters.

Parameters
p_rowthe Cell row
p_columnthe Cell column
p_typethe Cell type

Definition at line 63 of file arena.cpp.

void Arena::setName ( const QString &  p_strArenaName)

Sets the Arena name.

Parameters
p_strArenaNamethe Arena name

Definition at line 58 of file arena.cpp.


The documentation for this class was generated from the following files:
  • arena.h
  • arena.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