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; }; }; };
202 const tbCore::tbString& tileSetName,
const TileLocation& columnCount,
const TileLocation& rowCount);
208 const std::vector<TileSetIndex>& tileSetData,
const TileLocation& columnCount,
const TileLocation& rowCount);
218 void SetTile(
const tbCore::tbString& tileLayerName,
const TileLocation& tileColumn,
const TileLocation& tileRow,
219 const TileIndex& toTileIndex,
const TileSetIndex& toTileSetIndex = kInvalidTileSetIndex);
258 virtual void OnRender(
void)
const override;
267 TileLocation mTileColumns;
268 TileLocation mTileRows;
269 typedef std::vector<TileIndex> TileContainer;
270 TileContainer mTileData;
271 typedef std::vector<TileSetIndex> TileSetContainer;
272 TileSetContainer mTileSetData;
287 typedef std::map<tbCore::uint16, tbCore::DynamicStructure> TilePropertyTable;
288 TilePropertyTable mTileProperties;
292 typedef std::vector<tbCore::tbString> NameContainer;
293 typedef std::map<tbCore::tbString, TileLayer> TileLayerTable;
294 TileLayerTable mTileLayers;
295 NameContainer mOrderedLayerNames;
296 NameContainer mOrderedTileSetNames;
298 typedef std::map<tbCore::tbString, TileSet> TileSetTable;
299 TileSetTable mTileSets;
304 typedef std::map<tbCore::tbString, tbImplementation::TileSystemRenderer*> LayerRendererTable;
305 mutable LayerRendererTable mLayerRenderers;
307 TurtleBrains::Game::Unstable::TileSystemCollider* mCollider;
Definition: tb_vector.h:47
TileIndex mTileIndex
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:65
Definition: tb_graphic.h:61
int GetMapPropertyAsInteger(const tbCore::tbString &propertyName) const
bool IsPointInSolid(const tbMath::Vector2 &pointPosition) const
float mCenterY
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:70
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: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:74
float mCenterX
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:69
uint16_t uint16
Unsigned integer with a size of 16 bits. Supports values from 0 to 65535.
Definition: tb_types.h:25
static const DynamicStructure kNullValue
Definition: tb_dynamic_structure.h:556
Definition: tb_tile_system.h:89
Definition: tb_noncopyable.h:22
Contains all functions, classes and helpers related to game/application development written by Tim "B...
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: TIM: 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: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:67
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: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:78
tbCore::uint16 TileIndex
Definition: tb_tile_system.h:40
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: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:63
void UpdateColliderInformation(void)
Definition: tbu_bounding_volume.h:24
tbCore::DynamicStructure mPropertyValue
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:75
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:61
Definition: tb_dynamic_structure.h:28
float mWidth
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:73
tbCore::uint16 TileLocation
Definition: tb_tile_system.h:50
Definition: tb_sprite_map.h:23
tbCore::tbString mTileSetName
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:66
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: TIM: Documentation: Teach the user how to use this.
float mTop
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:71
void SetPropertiesForTile(const tbCore::tbString &tileSetName, const TileIndex &tileIndex, const tbCore::DynamicStructure &tileProperties)
tbCore::tbString GetMapPropertyAsString(const tbCore::tbString &propertyName) const
float mLeft
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:72
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: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:54
Definition: tb_application_dialog.h:19
virtual ~TileSystem(void)
TileLocation mColumn
TODO: TIM: Documentation: Teach the user how to use this.
Definition: tb_tile_system.h:64