Walls And Holes  1
Tile Class Reference

Class to represent each tile on the tileMap. More...

#include <tile.h>

Inheritance diagram for Tile:
Collaboration diagram for Tile:

Public Slots

void templateThicknessChanged ()
 
void templatePositionChanged ()
 

Signals

void tileChanged (int x, int y)
 
void tilePinged (int x, int y)
 

Public Member Functions

 Tile (TileTemplate *tileTemplate=nullptr, int xPos=-1, int yPos=-1, QObject *parent=nullptr)
 
bool hasTileTemplate () const
 
TileTemplatetileTemplate () const
 
float thickness () const
 
float height () const
 
QVector2D position () const
 
float relativeThickness () const
 
float relativeHeight () const
 
QVector2D relativePosition () const
 
const TileMaterialtopMaterial () const
 
const TileMaterialsideMaterial () const
 
float setRelativeThickness (float relativeThickness)
 setRelativeThickness More...
 
void setRelativeHeight (float relativeHeight)
 
QVector2D setRelativePosition (QVector2D relativePosition)
 
void resetTile (TileTemplate *newTileTemplate)
 

Detailed Description

Class to represent each tile on the tileMap.

Constructor & Destructor Documentation

◆ Tile()

Tile::Tile ( TileTemplate tileTemplate = nullptr,
int  xPos = -1,
int  yPos = -1,
QObject *  parent = nullptr 
)
explicit

Member Function Documentation

◆ hasTileTemplate()

bool Tile::hasTileTemplate ( ) const
inline
Here is the caller graph for this function:

◆ height()

float Tile::height ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ position()

QVector2D Tile::position ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ relativeHeight()

float Tile::relativeHeight ( ) const
inline
Here is the caller graph for this function:

◆ relativePosition()

QVector2D Tile::relativePosition ( ) const
inline
Here is the caller graph for this function:

◆ relativeThickness()

float Tile::relativeThickness ( ) const
inline
Here is the caller graph for this function:

◆ resetTile()

void Tile::resetTile ( TileTemplate newTileTemplate)

Sets all relative values to zero, and changes the tileTemplate to newTileTemplate

Here is the caller graph for this function:

◆ setRelativeHeight()

void Tile::setRelativeHeight ( float  relativeHeight)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRelativePosition()

QVector2D Tile::setRelativePosition ( QVector2D  relativePosition)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRelativeThickness()

float Tile::setRelativeThickness ( float  relativeThickness)

setRelativeThickness

Tries to set the relative thickness of this tile. Will be clipped such that relativeThickness + template->thickness will be in (0, 1].

Will also ensure that the thickness doesn't cause the tile to go out of bounds due to the tiles grid position.

Becuase of these, the ultimate value set may differ from that passed, so this returns the value that gets set.

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

◆ sideMaterial()

const TileMaterial * Tile::sideMaterial ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ templatePositionChanged

void Tile::templatePositionChanged ( )
inlineslot
Here is the call graph for this function:

◆ templateThicknessChanged

void Tile::templateThicknessChanged ( )
inlineslot
Here is the call graph for this function:

◆ thickness()

float Tile::thickness ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tileChanged

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

◆ tilePinged

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

◆ tileTemplate()

TileTemplate* Tile::tileTemplate ( ) const
inline
Here is the caller graph for this function:

◆ topMaterial()

const TileMaterial * Tile::topMaterial ( ) const
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: