CorsixTH Lua Documentation

Object Class

An `Entity` which occupies at least a single map tile and does not move.

Declared on: line 23 of Lua/entities/object.lua.
Inheritance: Object ยป Entity
Subclasses: AtomAnalyser, Bench, Door, EntranceDoor, Helicopter, Machine, OperatingSink, Plant, RadiationShield, ReceptionDesk, SideObject, SurgeonScreen

Method Index

Member Index

(*) only used in superclass methods
function Object:Object(world, object_type, x, y, direction, etc)

Parameters:

NameTypeDescription
world ? ?
object_type ? ?
x ? ?
y ? ?
direction ? ?
etc ? ?

Declared on: line 37 of Lua/entities/object.lua.

function Object:addReservedUser(user)

Adds a reserved user for this object. If multiple_users_allowed is set there can be many users reserving the object. reserved_for will then be the user who most recently reserved this object.

Parameters:

NameTypeDescription
user ? ?

Declared on: line 538 of Lua/entities/object.lua.

function Object:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: Entity:afterLoad.
Declared on: line 701 of Lua/entities/object.lua.

function Object:getRenderAttachTile()

Get the primary tile which the object is attached to for rendering

For objects which attach to a single tile for rendering, this method will return the X and Y Lua world co-ordinates of that tile. For objects which split their rendering over multiple tiles, one of them is arbitrarily designated as the primary tile, and its co-ordinates are returned.

Declared on: line 242 of Lua/entities/object.lua.

function Object:getWalkableTiles()

This function returns a list of all "only_passable" tiles belonging to an object. It must be overridden by objects which do not have a footprint, but walkable tiles (e.g. doors of any kind)

Declared on: line 281 of Lua/entities/object.lua.

function Object:initOrientation(direction)

Initializes the footprint, finds out what to draw and checks for split animations.

Parameters:

NameTypeDescription
direction ? The orientation in which the object is facing.

Declared on: line 60 of Lua/entities/object.lua.

function Object:isReservedFor(user)

Checks whether the object is reserved for the specified user. If the argument is nil a check for any reserved user is done.

Parameters:

NameTypeDescription
user ? ?

Declared on: line 585 of Lua/entities/object.lua.

function Object:onClick(ui, button, data)

Called when the object is clicked

Parameters:

NameTypeDescription
ui UI The active ui.
button string Which button was clicked.
data table If some data should be retained after moving an object it is in this table.

Declared on: line 611 of Lua/entities/object.lua.

function Object.processTypeDefinition(object_type)

Parameters:

NameTypeDescription
object_type ? ?

Declared on: line 727 of Lua/entities/object.lua.
Note: Is a function rather than a method.

function Object:removeReservedUser(user)

If multiple_users_allowed is true: Removes the user specified from this object's list of reserved users. If the argument is nil it is assumed that the list should be emptied. Note that if there are many humanoids reserving this object reserved_for might still be set after a call to this function. Otherwise: sets reserved_for to nil.

Parameters:

NameTypeDescription
user ? ?

Declared on: line 554 of Lua/entities/object.lua.

function Object:removeUser(user)

Removes a user from the set of users if multiple_users_allowed is set to true for this object. Otherwise it sets "user" to nil. Please don't directly change the variable "user".

Parameters:

NameTypeDescription
user ? ?

Declared on: line 508 of Lua/entities/object.lua.

function Object:setAnimation(animation, flags)

Parameters:

NameTypeDescription
animation ? ?
flags ? ?

Overrides: Entity:setAnimation.
Declared on: line 222 of Lua/entities/object.lua.

function Object:setPosition(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Overrides: Entity:setPosition.
Declared on: line 206 of Lua/entities/object.lua.

function Object:setTile(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Overrides: Entity:setTile.
Declared on: line 293 of Lua/entities/object.lua.

function Object:setUser(user)

Sets the user of this object to the given user. Note that if multiple_users_allowed is set to true for this object "user" will always be the last added user to this object. Please do not modify object.user directly.

Parameters:

NameTypeDescription
user ? The user that is about to use this object.

Declared on: line 491 of Lua/entities/object.lua.

function Object.slaveMixinClass(class_method_table)

Add methods to a class for creating and controlling a slave object

Parameters:

NameTypeDescription
class_method_table ? ?

Declared on: line 111 of Lua/entities/object.lua.
Note: Is a function rather than a method.

Page generated on Sat Feb 07, 2015 at 18:38:28 by LDocGen.