valid :: boolean [R] | Is this object valid? |
operator [] [RW] | Access, set or clear a fluid box. |
operator # :: uint [R] | Number of fluid boxes. |
An array of fluid boxes. Entities may contain more than one fluid box, and some can change the number of fluid boxes -- for instance, an assembling machine will change its number of fluid boxes depending on its active recipe. A fluid box is represented as a table:
entity
's first fluid box.
fluid = entity.fluidbox[1]
fluid.temperature = fluid.temperature * 2
entity.fluidbox[1] = fluid
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.
Access, set or clear a fluid box. The index must always be in bounds (see LuaFluidBox::operator #);
new fluidboxes may not be added or removed using this operator. If the given fluid box doesn't contain any
fluid, nil
is returned. Similarly, nil
can be written to a fluid box to remove all fluid from it.
Number of fluid boxes.