Walls And Holes  1
TileTemplate Class Reference

#include <tiletemplate.h>

Inheritance diagram for TileTemplate:
Collaboration diagram for TileTemplate:

Signals

void exclusivePropertyChanged ()
 Emitted when a property is changed but does not affect mesh-related properties. More...
 
void thicknessChanged ()
 
void positionChanged ()
 
void materialChanged ()
 
void changed ()
 Emitted whenever something changes that needs to be saved. More...
 
void pingTiles ()
 

Public Member Functions

 TileTemplate (QColor color=Qt::white, QString name="New Tile Template", float height=0, float thickness=1, TileMaterial *topMaterial=nullptr, QVector2D position=QVector2D(0.5, 0.5), bool bridgeTiles=false, bool connectDiagonals=false, QObject *parent=nullptr)
 
void setHeight (float height)
 
float setThickness (float thickness)
 setThickness More...
 
QVector2D setPosition (QVector2D position)
 setPosition More...
 
void setColor (QColor color)
 
void setHasSideMaterial (bool enabled)
 
void setTopMaterial (TileMaterial *material)
 Updates the top material for the tile template. More...
 
void setSideMaterial (TileMaterial *material)
 Updates the side material for the tile template. More...
 
QString name () const
 
void setName (QString name)
 
float height () const
 
float thickness () const
 
QVector2D position () const
 
QColor color () const
 
bool hasSideMaterial ()
 
const TileMaterialtopMaterial () const
 
TileMaterialtopMaterial ()
 
const TileMaterialsideMaterial () const
 
TileMaterialsideMaterial ()
 
bool bridgeTiles () const
 
void setBridgeTiles (bool enabled)
 
bool connectDiagonals () const
 
void setConnectDiagonals (bool enabled)
 
void emitTilePing ()
 emitTilePing Sends a signal to all tiles using this template, which will be forwarded to the containing TileMap, and handled there. Useful for gathing all tiles used by this template. More...
 

Constructor & Destructor Documentation

◆ TileTemplate()

TileTemplate::TileTemplate ( QColor  color = Qt::white,
QString  name = "New Tile Template",
float  height = 0,
float  thickness = 1,
TileMaterial topMaterial = nullptr,
QVector2D  position = QVector2D(0.5, 0.5),
bool  bridgeTiles = false,
bool  connectDiagonals = false,
QObject *  parent = nullptr 
)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ bridgeTiles()

bool TileTemplate::bridgeTiles ( ) const
inline
Here is the caller graph for this function:

◆ changed

void TileTemplate::changed ( )
signal

Emitted whenever something changes that needs to be saved.

Here is the caller graph for this function:

◆ color()

QColor TileTemplate::color ( ) const
inline
Here is the caller graph for this function:

◆ connectDiagonals()

bool TileTemplate::connectDiagonals ( ) const
inline
Here is the caller graph for this function:

◆ emitTilePing()

void TileTemplate::emitTilePing ( )
inline

emitTilePing Sends a signal to all tiles using this template, which will be forwarded to the containing TileMap, and handled there. Useful for gathing all tiles used by this template.

Here is the caller graph for this function:

◆ exclusivePropertyChanged

void TileTemplate::exclusivePropertyChanged ( )
signal

Emitted when a property is changed but does not affect mesh-related properties.

Here is the caller graph for this function:

◆ hasSideMaterial()

bool TileTemplate::hasSideMaterial ( )
inline
Here is the caller graph for this function:

◆ height()

float TileTemplate::height ( ) const
inline
Here is the caller graph for this function:

◆ materialChanged

void TileTemplate::materialChanged ( )
signal
Here is the caller graph for this function:

◆ name()

QString TileTemplate::name ( ) const
inline
Here is the caller graph for this function:

◆ pingTiles

void TileTemplate::pingTiles ( )
signal
Here is the caller graph for this function:

◆ position()

QVector2D TileTemplate::position ( ) const
inline
Here is the caller graph for this function:

◆ positionChanged

void TileTemplate::positionChanged ( )
signal
Here is the caller graph for this function:

◆ setBridgeTiles()

void TileTemplate::setBridgeTiles ( bool  enabled)
Here is the caller graph for this function:

◆ setColor()

void TileTemplate::setColor ( QColor  color)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConnectDiagonals()

void TileTemplate::setConnectDiagonals ( bool  enabled)
Here is the caller graph for this function:

◆ setHasSideMaterial()

void TileTemplate::setHasSideMaterial ( bool  enabled)
Here is the caller graph for this function:

◆ setHeight()

void TileTemplate::setHeight ( float  height)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setName()

void TileTemplate::setName ( QString  name)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPosition()

QVector2D TileTemplate::setPosition ( QVector2D  position)

setPosition

Tries to set the position of this template. If moving position away from the center, it is possible that it would make the bounds of the tile go outside the grid bounds. If this is the case, the position actually set will be different than that requested. The position value actually set is returned.

Parameters
position
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSideMaterial()

void TileTemplate::setSideMaterial ( TileMaterial material)

Updates the side material for the tile template.

Parameters
materialA pointer to the new material.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setThickness()

float TileTemplate::setThickness ( float  thickness)

setThickness

Tries to set the thickness of this template. If increasing thickness, it is possible that it would make the bounds of the tile go outside the grid bounds (for example if the position is not centered). If this is the case, the thickness actually set will be less than that requested. The thickness value actually set is returned.

Parameters
thickness
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTopMaterial()

void TileTemplate::setTopMaterial ( TileMaterial material)

Updates the top material for the tile template.

Parameters
materialA pointer to the new material.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sideMaterial() [1/2]

const TileMaterial* TileTemplate::sideMaterial ( ) const
inline
Here is the caller graph for this function:

◆ sideMaterial() [2/2]

TileMaterial* TileTemplate::sideMaterial ( )
inline

◆ thickness()

float TileTemplate::thickness ( ) const
inline
Here is the caller graph for this function:

◆ thicknessChanged

void TileTemplate::thicknessChanged ( )
signal
Here is the caller graph for this function:

◆ topMaterial() [1/2]

const TileMaterial* TileTemplate::topMaterial ( ) const
inline
Here is the caller graph for this function:

◆ topMaterial() [2/2]

TileMaterial* TileTemplate::topMaterial ( )
inline

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