Walls And Holes  1
TileMap Class Reference

#include <tilemap.h>

Inheritance diagram for TileMap:
Collaboration diagram for TileMap:

Public Slots

void tilePinged (int x, int y)
 

Signals

void tileChanged (int x, int y)
 
void resized ()
 
void mapChanged ()
 Sent out whenever the map is changed in any way. Happens after tileChanged() and resized() signals. More...
 

Public Member Functions

 TileMap (QSize mapSize, bool isIndoors, bool hasCeiling, QObject *parent=nullptr)
 
TiletileAt (int x, int y)
 
const TilecTileAt (int x, int y) const
 
const Array2D< QSharedPointer< Tile > > & getArray2D () const
 Returns a representation of this map as an Array2D. More...
 
void setTile (int x, int y, TileTemplate *tileTemplate)
 
void clearTile (int x, int y)
 
void clear ()
 
QSize mapSize () const
 
bool contains (int x, int y) const
 
int width () const
 
int height () const
 
bool isIndoor () const
 
bool hasCeiling () const
 
void resizeMap (QSize newSize)
 resizeMap More...
 
const QString savePath () const
 
void setSavePath (QString path)
 
const Array2D< QSharedPointer< Tile > > & cTiles () const
 
bool isTileTemplateUsed (TileTemplate *tileTemplate)
 tileTemplateUsed Returns true if some tile in the map uses this tileTemplate More...
 
bool isTileTemplateSetUsed (TileTemplateSet *tileTemplateSet)
 tileTemplateSetUsed Returns true if some tile in the map uses any of the tileTemplates of the given set More...
 
void removingTileTemplateSet (TileTemplateSet *tileTemplateSet)
 removingTileTemplateSet Called when a tileTemplateSet is going to be removed. Any tiles using templates from the set will be cleared. More...
 
void removingTileTemplate (TileTemplate *tileTemplate)
 removeTileTemplate Called when a tileTemplate is going to be removed. Any tiles using template will be cleared. More...
 
QVector< QPoint > tilePositionsUsingTemplate (TileTemplate *tileTemplate)
 tilePositionsUsingTemplate Finds the positions of all the tiles using a given TileTemplate. More...
 
QVector< QPoint > tilePositionsUsingTemplateSet (TileTemplateSet *tileTemplateSet)
 tilePositionsUsingTemplateSet Finds the positions of all the tiles using a given TileTemplateSet. More...
 
TileTemplateSetdefaultTileTemplateSet ()
 

Constructor & Destructor Documentation

◆ TileMap()

TileMap::TileMap ( QSize  mapSize,
bool  isIndoors,
bool  hasCeiling,
QObject *  parent = nullptr 
)
Here is the call graph for this function:

Member Function Documentation

◆ clear()

void TileMap::clear ( )
Here is the call graph for this function:

◆ clearTile()

void TileMap::clearTile ( int  x,
int  y 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains()

bool TileMap::contains ( int  x,
int  y 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cTileAt()

const Tile & TileMap::cTileAt ( int  x,
int  y 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cTiles()

const Array2D<QSharedPointer<Tile> >& TileMap::cTiles ( ) const
inline

◆ defaultTileTemplateSet()

TileTemplateSet* TileMap::defaultTileTemplateSet ( )
inline
Here is the caller graph for this function:

◆ getArray2D()

const Array2D< QSharedPointer< Tile > > & TileMap::getArray2D ( ) const

Returns a representation of this map as an Array2D.

Useful to access special Array2D iterators.

Returns
An Array2D such that arr(x, y) == tileAt(x, y)
Here is the caller graph for this function:

◆ hasCeiling()

bool TileMap::hasCeiling ( ) const
inline
Here is the caller graph for this function:

◆ height()

int TileMap::height ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isIndoor()

bool TileMap::isIndoor ( ) const
inline
Here is the caller graph for this function:

◆ isTileTemplateSetUsed()

bool TileMap::isTileTemplateSetUsed ( TileTemplateSet tileTemplateSet)

tileTemplateSetUsed Returns true if some tile in the map uses any of the tileTemplates of the given set

Parameters
tileTemplateSetThe set to check
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTileTemplateUsed()

bool TileMap::isTileTemplateUsed ( TileTemplate tileTemplate)

tileTemplateUsed Returns true if some tile in the map uses this tileTemplate

Parameters
tileTemplateThe tile template to check.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mapChanged

void TileMap::mapChanged ( )
signal

Sent out whenever the map is changed in any way. Happens after tileChanged() and resized() signals.

Here is the caller graph for this function:

◆ mapSize()

QSize TileMap::mapSize ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removingTileTemplate()

void TileMap::removingTileTemplate ( TileTemplate tileTemplate)

removeTileTemplate Called when a tileTemplate is going to be removed. Any tiles using template will be cleared.

Parameters
tileTemplate
Here is the call graph for this function:

◆ removingTileTemplateSet()

void TileMap::removingTileTemplateSet ( TileTemplateSet tileTemplateSet)

removingTileTemplateSet Called when a tileTemplateSet is going to be removed. Any tiles using templates from the set will be cleared.

Parameters
tileTemplateSet
Here is the call graph for this function:

◆ resized

void TileMap::resized ( )
signal
Here is the caller graph for this function:

◆ resizeMap()

void TileMap::resizeMap ( QSize  newSize)

resizeMap

Changes the size of the map. If the size is reduced, tiles will be lost (resizes around top left corner)

Parameters
newSize
Here is the call graph for this function:
Here is the caller graph for this function:

◆ savePath()

const QString TileMap::savePath ( ) const
inline
Here is the caller graph for this function:

◆ setSavePath()

void TileMap::setSavePath ( QString  path)
inline
Here is the caller graph for this function:

◆ setTile()

void TileMap::setTile ( int  x,
int  y,
TileTemplate tileTemplate 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tileAt()

Tile & TileMap::tileAt ( int  x,
int  y 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tileChanged

void TileMap::tileChanged ( int  x,
int  y 
)
signal
Here is the caller graph for this function:

◆ tilePinged

void TileMap::tilePinged ( int  x,
int  y 
)
slot
Here is the caller graph for this function:

◆ tilePositionsUsingTemplate()

QVector< QPoint > TileMap::tilePositionsUsingTemplate ( TileTemplate tileTemplate)

tilePositionsUsingTemplate Finds the positions of all the tiles using a given TileTemplate.

Parameters
tileTemplateThe tile template.
Returns
The positions of the tiles that use tileTemplate.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tilePositionsUsingTemplateSet()

QVector< QPoint > TileMap::tilePositionsUsingTemplateSet ( TileTemplateSet tileTemplateSet)

tilePositionsUsingTemplateSet Finds the positions of all the tiles using a given TileTemplateSet.

Parameters
tileTemplateSetThe tile template set.
Returns
The positions of the tiles that use tileTemplateSet.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ width()

int TileMap::width ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: