Class Tile
Implements tile Objects which are data containers for important
map information need for room generation and room accretion.
Usage:
Tile()
Info:
- Copyright: Creative Commons Attribution 4.0 International License
- Author: LonelyOwl
tile.Class |
List of data structures contained within. |
-
tile.Class
-
List of data structures contained within.
- id
(string) Unique id for every tile created.
- roomid
(string) Unique id of the room the tile belongs to.
- dungeon
(string) Unique id of the dungeon the tile belongs to.
- x
(int) local room position of tile.
- y
(int) local room position of tile.
- wx
(int) world position of tile.
- wy
(int) world position of tile.
- type
(string) tile type used for discerning.
Methods
-
tile._createUUID ()
-
Create unique id string for tiles created.
-
tile:setType (type)
-
Accessor function for setting tile type.
Parameters:
-
tile:setLocalPosition (x, y)
-
Accessor function for setting tile's position in room.
Parameters:
-
tile:setWorldPosition (x, y)
-
Accessor function for setting tile's position in world.
Parameters:
-
tile:setProperty (property, value)
-
Accessor function for setting any property of a tile.
Parameters:
-
tile:hasProperty (property)
-
Returns a boolean on whether a tile has the specified property or not.
Parameters:
-
tile:getProperty (property)
-
Returns the specified property value defined, or false.
Parameters:
-
tile:getType (compare)
-
Accessor function to return a tiles type.
Parameters:
- compare
if comparison is given, return boolean instead.
-
tile:getLocalPosition ()
-
Returns local room position of a tile.
-
tile:getWorldPosition ()
-
Returns the world position of a tile.
-
tile:createTile (room, x, y, type)
-
Builder function for tile instances. Only accepts local (x,y) values.
Parameters:
Usage:
Tile():createTile(object room, int x, int y, string type)
-
tile:deserialize (...)
-
Not implemented.
Parameters:
-
tile:serialize ()
-
Called by room serialize method, or directly. Serializes
tile data by generating an array without any userData values.