The core class to be aware of in the Tidy TileMapper Runtime API is:
The core actions you will wish to perform on a BlockMap at runtime are generally:
- Create a map
- Add a block to the map
- Remove a block from the map
- Get the block located at given coordinates.
The BlockUtilities class provides the ability to do this, along with a few other functions that may be handy.
As the tool was initial designed as an Editor extension (and not an API) this class has been developed to wrap the mapping classes and provide easy, moderately-comprehensive - and most of all, robust access to the functions of Tidy TileMapper at runtime.
Tidy TileMapper is based on a few key concepts:
- A Block is the smallest component of a map.
- It is a single tile on a map, and contains definitions of the visual representation of that 'type' of tile.
- Example: Grass Block
- Contains all orientations of this grass block (Grass with emptiness above, soil when surrounded by Blocks, etc)
- These orientations are called BlockSets.
- Each BlockSet can contain multiple objects that can be displayed on the map.
- These objects are called Variants.
- This is best demonstrated by using the Block Editor.
- A MapChunk is a section of a BlockMap, containing multiple Blocks.
- It allows operations on a BlockMap at a subset-level.
- This is best demosntrated by using the Editor Extension and painting yourself a fine map.
- We're arrived! The glorious BlockMap.
- This is essentially a grid of many MapChunks, each containing many Blocks.
- It allows addition and querying of Blocks with a simple coordinate system:
- X: As expected, left and right.
- Y: Map-specific: Up and down on an Upward-growing map, Forward and Backward on a Forward-growing map.
- Depth (Z): The leftover! Up and down on a Forward-growing map, Forward and Backward on an Upward-growing map.