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

Fields

tile.Class List of data structures contained within.

Local Functions

tile._createUUID () Create unique id string for tiles created.

Methods

tile:setType (type) Accessor function for setting tile type.
tile:setLocalPosition (x, y) Accessor function for setting tile's position in room.
tile:setWorldPosition (x, y) Accessor function for setting tile's position in world.
tile:setProperty (property, value) Accessor function for setting any property of a tile.
tile:hasProperty (property) Returns a boolean on whether a tile has the specified property or not.
tile:getProperty (property) Returns the specified property value defined, or false.
tile:getType (compare) Accessor function to return a tiles type.
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.
tile:deserialize (...) Not implemented.
tile:serialize () Called by room serialize method, or directly.


Fields

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.

Local Functions

Methods
tile._createUUID ()
Create unique id string for tiles created.

Methods

tile:setType (type)
Accessor function for setting tile type.

Parameters:

  • type
tile:setLocalPosition (x, y)
Accessor function for setting tile's position in room.

Parameters:

  • x
  • y
tile:setWorldPosition (x, y)
Accessor function for setting tile's position in world.

Parameters:

  • x
  • y
tile:setProperty (property, value)
Accessor function for setting any property of a tile.

Parameters:

  • property
  • value
tile:hasProperty (property)
Returns a boolean on whether a tile has the specified property or not.

Parameters:

  • property
tile:getProperty (property)
Returns the specified property value defined, or false.

Parameters:

  • property
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:

  • room
  • x
  • y
  • type

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.
generated by LDoc 1.5.0 Last updated 2023-09-01 10:24:59