Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
core::map::Tile Class Reference

Data representation of a tile in a Map TileLayer. More...

#include <Tile.hpp>

Public Types

using IdType = std::uint16_t
 

Public Member Functions

 Tile ()
 Makes a blank tile. More...
 
 Tile (const Tile &copy)=default
 Copy constructs from the given tile. More...
 
Tileoperator= (const Tile &copy)=default
 Copy constructs from the given tile. More...
 
 Tile (IdType id, bool isAnim=false)
 Builds a tile with the given info. More...
 
bool isAnimation () const
 Returns whether this tile is an animation or not. More...
 
IdType id () const
 Returns the id of the image or animation of this tile. More...
 
void set (IdType id, bool anim)
 Sets the information of the tile. More...
 
void step ()
 Triggers the animation when the tile is stepped on. More...
 

Static Public Attributes

static constexpr IdType Blank = 0
 Special id for blank tiles. More...
 

Friends

class Map
 
class editor::component::EditMap
 
struct bl::serial::SerializableObject< Tile >
 

Detailed Description

Data representation of a tile in a Map TileLayer.

Definition at line 30 of file Tile.hpp.

Member Typedef Documentation

◆ IdType

using core::map::Tile::IdType = std::uint16_t

Definition at line 33 of file Tile.hpp.

Constructor & Destructor Documentation

◆ Tile() [1/3]

core::map::Tile::Tile ( )

Makes a blank tile.

Definition at line 10 of file Tile.cpp.

◆ Tile() [2/3]

core::map::Tile::Tile ( const Tile copy)
default

Copy constructs from the given tile.

Parameters
copyThe tile to copy

◆ Tile() [3/3]

core::map::Tile::Tile ( IdType  id,
bool  isAnim = false 
)

Builds a tile with the given info.

Parameters
idThe id of the tile in the tileset
isAnimTrue if the tile is an animation, false if it is an image

Definition at line 14 of file Tile.cpp.

Member Function Documentation

◆ id()

Tile::IdType core::map::Tile::id ( ) const

Returns the id of the image or animation of this tile.

Returns
IdType The id of the tile in the tileset

Definition at line 22 of file Tile.cpp.

◆ isAnimation()

bool core::map::Tile::isAnimation ( ) const

Returns whether this tile is an animation or not.

Returns
True if an animation, false if a still image

Definition at line 20 of file Tile.cpp.

◆ operator=()

Tile& core::map::Tile::operator= ( const Tile copy)
default

Copy constructs from the given tile.

Parameters
copyThe tile to copy
Returns
A reference to this tile

◆ set()

void core::map::Tile::set ( IdType  id,
bool  anim 
)

Sets the information of the tile.

Parameters
tilesetReference to the Tileset being used
idThe id of the image or animation in the Tileset
animTrue if an animation, false if an image

Definition at line 24 of file Tile.cpp.

◆ step()

void core::map::Tile::step ( )

Triggers the animation when the tile is stepped on.

Definition at line 29 of file Tile.cpp.

Friends And Related Function Documentation

◆ bl::serial::SerializableObject< Tile >

friend struct bl::serial::SerializableObject< Tile >
friend

Definition at line 105 of file Tile.hpp.

◆ editor::component::EditMap

friend class editor::component::EditMap
friend

Definition at line 105 of file Tile.hpp.

◆ Map

friend class Map
friend

Definition at line 104 of file Tile.hpp.

Member Data Documentation

◆ Blank

constexpr IdType core::map::Tile::Blank = 0
staticconstexpr

Special id for blank tiles.

Definition at line 36 of file Tile.hpp.


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