9 #ifndef TurtleBrains_TileSystem_hpp
10 #define TurtleBrains_TileSystem_hpp
12 #include <turtle_brains/core/tb_string.hpp>
13 #include <turtle_brains/core/tb_dynamic_structure.hpp>
14 #include <turtle_brains/graphics/tb_graphic_list.hpp>
15 #include <turtle_brains/graphics/tb_sprite_map.hpp>
16 #include <turtle_brains/math/tb_vector.hpp>
21 namespace TurtleBrains::Graphics::Implementation {
class TileSystemRenderer; };
22 namespace TurtleBrains::Game::Unstable {
class TileSystemCollider; };
23 namespace TurtleBrains::Math::Unstable {
class BoundingVolume; };
179 const String& propertyName,
const String& propertyValue);
185 const String& propertyName,
const int propertyValue);
191 const String& propertyName,
const bool propertyValue);
196 void AddTileLayer(
const String& tileLayerName,
const std::vector<TileIndex>& tileData,
202 void AddTileLayer(
const String& tileLayerName,
const std::vector<TileIndex>& tileData,
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<String> NameContainer;
293 typedef std::map<String, TileLayer> TileLayerTable;
294 TileLayerTable mTileLayers;
295 NameContainer mOrderedLayerNames;
296 NameContainer mOrderedTileSetNames;
298 typedef std::map<String, TileSet> TileSetTable;
299 TileSetTable mTileSets;
304 typedef std::map<String, TurtleBrains::Graphics::Implementation::TileSystemRenderer*> LayerRendererTable;
305 mutable LayerRendererTable mLayerRenderers;
307 TurtleBrains::Game::Unstable::TileSystemCollider* mCollider;
Definition: tb_dynamic_structure.hpp:95
static const DynamicStructure kNullValue
Definition: tb_dynamic_structure.hpp:908
Definition: tb_noncopyable.hpp:21
Definition: tb_entity.hpp:47
Definition: tb_tile_system.hpp:85
void SetLayerVisible(const String &tileLayerName, const bool isVisible)
bool IsPointInSolid(const tbMath::Vector2 &pointPosition) const
virtual ~TileSystem(void)
virtual void OnRender(void) const override
void SetTileProperty(const String &tileSetName, const TileIndex &tileIndex, const String &propertyName, const int propertyValue)
void AddTileSet(const String &tilesetName, const tbGraphics::SpriteMap &spriteMap, const tbCore::DynamicStructure &tileSetProperties=tbCore::DynamicStructure::kNullValue)
AboutTileContainer FindTilesWithPropertyEquals(const String &tileProperty, int propertyValue, bool onlyVisibleLayers=false) const
void AddTileLayer(const String &tileLayerName, const std::vector< TileIndex > &tileData, const std::vector< TileSetIndex > &tileSetData, const TileLocation &columnCount, const TileLocation &rowCount)
String GetTilePropertyAsString(const String &tileSetName, const TileIndex &tileIndex, const String &propertyName) const
bool GetTilePropertyAsBoolean(const String &tileSetName, const TileIndex &tileIndex, const String &propertyName) const
AboutTileContainer FindTilesWithProperty(const String &tileProperty, bool onlyVisibleLayers=false) const
void AddTileLayer(const String &tileLayerName, const std::vector< TileIndex > &tileData, const String &tileSetName, const TileLocation &columnCount, const TileLocation &rowCount)
AboutTileContainer FindTilesWithPropertyEquals(const String &tileProperty, const String &propertyValue, bool onlyVisibleLayers=false) const
void SetTile(const String &tileLayerName, const TileLocation &tileColumn, const TileLocation &tileRow, const TileIndex &toTileIndex, const TileSetIndex &toTileSetIndex=kInvalidTileSetIndex)
int GetMapPropertyAsInteger(const String &propertyName) const
void SetTileProperty(const String &tileSetName, const TileIndex &tileIndex, const String &propertyName, const bool propertyValue)
void SetTileProperty(const String &tileSetName, const TileIndex &tileIndex, const String &propertyName, const String &propertyValue)
AboutTileContainer FindTilesWithPropertyEquals(const String &tileProperty, bool propertyValue, bool onlyVisibleLayers=false) const
void SetPropertiesForMap(const tbCore::DynamicStructure &mapProperties)
void UpdateColliderInformation(void)
bool MoveEntity(Entity &entity, const tbMath::Vector2 &fromOldPosition, const tbMath::Vector2 &toNewPosition) const
bool MoveEntity(const tbMath::Vector2 ¤tPosition, tbMath::Vector2 &finalPosition, const TurtleBrains::Math::Unstable::BoundingVolume &boundingVolume) const
void SetPropertiesForTile(const String &tileSetName, const TileIndex &tileIndex, const tbCore::DynamicStructure &tileProperties)
int GetTilePropertyAsInteger(const String &tileSetName, const TileIndex &tileIndex, const String &propertyName) const
bool GetMapPropertyAsBoolean(const String &propertyName) const
String GetMapPropertyAsString(const String &propertyName) const
Definition: tb_graphic.hpp:50
Definition: tb_sprite_map.hpp:22
Definition: tb_vector.hpp:99
Definition: tbu_bounding_volume.hpp:25
std::uint8_t uint8
Unsigned integer with a size of 8 bits. Supports values from 0 to 255.
Definition: tb_types.hpp:22
std::uint16_t uint16
Unsigned integer with a size of 16 bits. Supports values from 0 to 65535.
Definition: tb_types.hpp:25
This is the heart of TurtleBrains for game developers to create GameScenes and Entities to interact w...
tbCore::uint16 TileLocation
Definition: tb_tile_system.hpp:45
std::vector< AboutTile > AboutTileContainer
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:73
const TileLocation kInvalidTileLocation
TODO: TurtleBrains: Documentation: Teach the user how to use this.
const TileSetIndex kInvalidTileSetIndex
TODO: TurtleBrains: Documentation: Teach the user how to use this.
tbCore::uint8 TileSetIndex
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:49
tbCore::uint16 TileIndex
Definition: tb_tile_system.hpp:27
const TileIndex kInvalidTileIndex
Definition: tb_tile_system.hpp:57
tbCore::DynamicStructure mPropertyValue
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:70
float mCenterX
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:64
float mLeft
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:67
float mTop
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:66
TileLocation mRow
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:58
String mLayerName
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:62
TileIndex mTileIndex
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:60
float mWidth
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:68
String mTileSetName
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:61
float mHeight
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:69
float mCenterY
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:65
TileLocation mColumn
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Definition: tb_tile_system.hpp:59