9 #ifndef _TurtleBrains_TileSystem_h_
10 #define _TurtleBrains_TileSystem_h_
12 #include "../core/tb_string.h"
13 #include "../core/tb_dynamic_structure.h"
14 #include "../graphics/tb_graphic_list.h"
15 #include "../graphics/tb_sprite_map.h"
16 #include "../math/tb_vector.h"
23 class TileSystemRenderer;
26 namespace TurtleBrains {
namespace Game {
namespace Unstable {
class TileSystemCollider; }; }; };
27 namespace TurtleBrains {
namespace Math {
namespace Unstable {
class BoundingVolume; }; }; };
203 const tbCore::tbString& tileSetName,
const TileLocation& columnCount,
const TileLocation& rowCount);
209 const std::vector<TileSetIndex>& tileSetData,
const TileLocation& columnCount,
const TileLocation& rowCount);
219 void SetTile(
const tbCore::tbString& tileLayerName,
const TileLocation& tileColumn,
const TileLocation& tileRow,
220 const TileIndex& toTileIndex,
const TileSetIndex& toTileSetIndex = kInvalidTileSetIndex);
264 virtual void OnRender(
void)
const override;
273 TileLocation mTileColumns;
274 TileLocation mTileRows;
275 typedef std::vector<TileIndex> TileContainer;
276 TileContainer mTileData;
277 typedef std::vector<TileSetIndex> TileSetContainer;
278 TileSetContainer mTileSetData;
293 typedef std::map<tbCore::uint16, tbCore::DynamicStructure> TilePropertyTable;
294 TilePropertyTable mTileProperties;
298 typedef std::vector<tbCore::tbString> NameContainer;
299 typedef std::map<tbCore::tbString, TileLayer> TileLayerTable;
300 TileLayerTable mTileLayers;
301 NameContainer mOrderedLayerNames;
302 NameContainer mOrderedTileSetNames;
304 typedef std::map<tbCore::tbString, TileSet> TileSetTable;
305 TileSetTable mTileSets;
310 typedef std::map<tbCore::tbString, tbImplementation::TileSystemRenderer*> LayerRendererTable;
311 mutable LayerRendererTable mLayerRenderers;
313 TurtleBrains::Game::Unstable::TileSystemCollider* mCollider;
Definition: tb_vector.h:47
TileIndex mTileIndex
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:66
Definition: tb_graphic.h:61
Definition: tb_entity.h:46
int GetMapPropertyAsInteger(const tbCore::tbString &propertyName) const
bool IsPointInSolid(const tbMath::Vector2 &pointPosition) const
float mCenterY
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:71
void AddTileSet(const tbCore::tbString &tilesetName, const tbGraphics::SpriteMap &spriteMap, const tbCore::DynamicStructure &tileSetProperties=tbCore::DynamicStructure::kNullValue)
AboutTileContainer FindTilesWithProperty(const tbCore::tbString &tileProperty, bool onlyVisibleLayers=false) const
virtual void OnRender(void) const override
float mHeight
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:75
float mCenterX
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:70
uint16_t uint16
Unsigned integer with a size of 16 bits. Supports values from 0 to 65535.
Definition: tb_types.h:26
static const DynamicStructure kNullValue
Definition: tb_dynamic_structure.h:707
Definition: tb_tile_system.h:90
Definition: tb_noncopyable.h:22
Here is some information about the primary namespace.
Definition: tb_application_dialog.h:21
bool MoveEntity(const tbMath::Vector2 ¤tPosition, tbMath::Vector2 &finalPosition, const TurtleBrains::Math::Unstable::BoundingVolume &boundingVolume) const
const TileSetIndex kInvalidTileSetIndex
TODO: TurtleBrains: Documentation: Teach the user how to use this.
int GetTilePropertyAsInteger(const tbCore::tbString &tileSetName, const TileIndex &tileIndex, const tbCore::tbString &propertyName) const
void SetLayerVisible(const tbCore::tbString &tileLayerName, const bool isVisible)
tbCore::tbString mLayerName
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:68
void SetPropertiesForMap(const tbCore::DynamicStructure &mapProperties)
bool GetTilePropertyAsBoolean(const tbCore::tbString &tileSetName, const TileIndex &tileIndex, const tbCore::tbString &propertyName) const
std::vector< AboutTile > AboutTileContainer
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:79
tbCore::uint16 TileIndex
Definition: tb_tile_system.h:33
uint8_t uint8
Unsigned integer with a size of 8 bits. Supports values from 0 to 255.
Definition: tb_types.h:23
TileLocation mRow
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:64
void UpdateColliderInformation(void)
Definition: tbu_bounding_volume.h:24
tbCore::DynamicStructure mPropertyValue
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:76
void SetTile(const tbCore::tbString &tileLayerName, const TileLocation &tileColumn, const TileLocation &tileRow, const TileIndex &toTileIndex, const TileSetIndex &toTileSetIndex=kInvalidTileSetIndex)
tbCore::tbString GetTilePropertyAsString(const tbCore::tbString &tileSetName, const TileIndex &tileIndex, const tbCore::tbString &propertyName) const
Definition: tb_tile_system.h:62
Definition: tb_dynamic_structure.h:57
float mWidth
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:74
tbCore::uint16 TileLocation
Definition: tb_tile_system.h:51
Definition: tb_sprite_map.h:23
tbCore::tbString mTileSetName
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:67
void AddTileLayer(const tbCore::tbString &tileLayerName, const std::vector< TileIndex > &tileData, const tbCore::tbString &tileSetName, const TileLocation &columnCount, const TileLocation &rowCount)
AboutTileContainer FindTilesWithPropertyEquals(const tbCore::tbString &tileProperty, bool propertyValue, bool onlyVisibleLayers=false) const
void SetTileProperty(const tbCore::tbString &tileSetName, const TileIndex &tileIndex, const tbCore::tbString &propertyName, const tbCore::tbString &propertyValue)
const TileLocation kInvalidTileLocation
TODO: TurtleBrains: Documentation: Teach the user how to use this.
float mTop
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:72
void SetPropertiesForTile(const tbCore::tbString &tileSetName, const TileIndex &tileIndex, const tbCore::DynamicStructure &tileProperties)
tbCore::tbString GetMapPropertyAsString(const tbCore::tbString &propertyName) const
float mLeft
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:73
const TileIndex kInvalidTileIndex
bool GetMapPropertyAsBoolean(const tbCore::tbString &propertyName) const
std::string tbString
Definition: tb_string.h:335
This is the heart of TurtleBrains for game developers to create GameScenes and Entities to interact w...
tbCore::uint8 TileSetIndex
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:55
Definition: tb_application_dialog.h:19
virtual ~TileSystem(void)
TileLocation mColumn
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:65