pub struct LuaTile;Expand description
A single “square” on the map.
Implementations§
Source§impl LuaTile
impl LuaTile
The name of the LuaTilePrototype double hidden under this tile or nil if there is no double hidden tile.
During normal gameplay, only non-mineable tiles can become double hidden. This can however be circumvented with LuaSurface::set_double_hidden_tile.
The name of the LuaTilePrototype hidden under this tile, if any.
During normal gameplay, only non-mineable or foundation tiles can become hidden. This can however be circumvented with LuaSurface::set_hidden_tile.
Sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &str
The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
Sourcepub fn position(&self) -> TilePosition
pub fn position(&self) -> TilePosition
The position this tile references.
pub fn prototype(&self) -> LuaTilePrototype
Sourcepub fn surface(&self) -> LuaSurface
pub fn surface(&self) -> LuaSurface
The surface this tile is on.
Sourcepub fn valid(&self) -> bool
pub fn valid(&self) -> bool
Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
Sourcepub fn cancel_deconstruction(&self, force: LuaAny, player: Option<LuaAny>)
pub fn cancel_deconstruction(&self, force: LuaAny, player: Option<LuaAny>)
Cancels deconstruction if it is scheduled, does nothing otherwise.
Sourcepub fn collides_with(&self, layer: CollisionLayerID) -> bool
pub fn collides_with(&self, layer: CollisionLayerID) -> bool
What type of things can collide with this tile?
Sourcepub fn get_tile_ghosts(&self, force: Option<LuaAny>) -> Vec<LuaEntity>
pub fn get_tile_ghosts(&self, force: Option<LuaAny>) -> Vec<LuaEntity>
Gets all tile ghosts on this tile.
Sourcepub fn has_tile_ghost(&self, force: Option<LuaAny>) -> bool
pub fn has_tile_ghost(&self, force: Option<LuaAny>) -> bool
Does this tile have any tile ghosts on it.
Sourcepub fn order_deconstruction(
&self,
force: LuaAny,
player: Option<LuaAny>,
) -> Option<LuaEntity>
pub fn order_deconstruction( &self, force: LuaAny, player: Option<LuaAny>, ) -> Option<LuaEntity>
Orders deconstruction of this tile by the given force.
Sourcepub fn to_be_deconstructed(&self, force: Option<LuaAny>) -> bool
pub fn to_be_deconstructed(&self, force: Option<LuaAny>) -> bool
Is this tile marked for deconstruction?