The tile object: Difference between revisions
(Created Page) |
m (Added to category lua resources) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category: Resources]] | [[Category:Lua Resources]] | ||
Back To [[TOTPP Functions]] | Back To [[TOTPP Functions]] | ||
[[tile.x|x | [[tile.x|x]] (get) | ||
<code>tile.x -> integer</code> | <code>tile.x -> integer</code> | ||
Line 9: | Line 9: | ||
[[tile.y|y | [[tile.y|y]] (get) | ||
<code>tile.y -> integer</code> | <code>tile.y -> integer</code> | ||
Line 16: | Line 16: | ||
[[tile.z|z | [[tile.z|z]] (get) | ||
<code>tile.z -> integer</code> | <code>tile.z -> integer</code> |
Latest revision as of 20:10, 26 January 2019
Back To TOTPP Functions
x (get)
tile.x -> integer
Returns the `x` coordinate of the tile.
y (get)
tile.y -> integer
Returns the `y` coordinate of the tile.
z (get)
tile.z -> integer
Returns the `z` coordinate of the tile (map number).
terrainType (get/set)
tile.terrainType -> integer
Returns the terrain type of the tile.
owner (get)
tile.owner -> tribe
Returns the tribe owning the tile.
improvements (get/set)
tile.improvements -> integer
Returns the tile's improvements (bitmask).
fertility (get/set)
tile.fertility -> integer
Returns the tile's fertility.
landmass (get/set)
tile.landmass -> integer
Returns the tile's landmass index.
city (get)
tile.city -> city
Returns the city at the tile's location, or `nil` if there's no city there.
units (get)
tile.units -> iterator
Returns an iterator yielding all units at the tile's location.
defender (get)
tile.defender -> tribe
Returns the tile's defender.