pub struct LuaTransportLine;Expand description
One line on a transport belt.
Implementations§
Source§impl LuaTransportLine
impl LuaTransportLine
Sourcepub fn input_lines(&self) -> Vec<LuaTransportLine>
pub fn input_lines(&self) -> Vec<LuaTransportLine>
The transport lines that this transport line is fed by or an empty table if none.
Sourcepub fn line_length(&self) -> f32
pub fn line_length(&self) -> f32
Length of the transport line. Items can be inserted at line position from 0 up to returned value
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 output_lines(&self) -> Vec<LuaTransportLine>
pub fn output_lines(&self) -> Vec<LuaTransportLine>
The transport lines that this transport line outputs items to or an empty table if none.
Sourcepub fn total_segment_length(&self) -> f64
pub fn total_segment_length(&self) -> f64
Total length of segment which consists of this line, all lines in front and lines in the back directly connected.
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 can_insert_at(&self, position: f32) -> bool
pub fn can_insert_at(&self, position: f32) -> bool
Can an item be inserted at a given position?
Sourcepub fn can_insert_at_back(&self) -> bool
pub fn can_insert_at_back(&self) -> bool
Can an item be inserted at the back of this line?
Sourcepub fn force_insert_at(
&self,
belt_stack_size: Option<u8>,
items: LuaAny,
position: f32,
)
pub fn force_insert_at( &self, belt_stack_size: Option<u8>, items: LuaAny, position: f32, )
Force insert item at a given position. Inserts item onto a transport line. If a position is out of range, it is clamped to a closest valid position on the transport line. Item will be inserted regardless of other items nearby, possibly forcing items to become squashed.
Sourcepub fn get_contents(&self) -> Vec<ItemWithQualityCount>
pub fn get_contents(&self) -> Vec<ItemWithQualityCount>
Get counts of all items on this line, similar to how LuaInventory::get_contents does.
Sourcepub fn get_detailed_contents(&self) -> Vec<DetailedItemOnLine>
pub fn get_detailed_contents(&self) -> Vec<DetailedItemOnLine>
Get detailed information of items on this line, such as their position.
Sourcepub fn get_item_count(&self, item: Option<ItemFilter>) -> u32
pub fn get_item_count(&self, item: Option<ItemFilter>) -> u32
Count some or all items on this line, similar to how LuaInventory::get_item_count does.
Sourcepub fn get_line_item_position(&self, position: f32) -> MapPosition
pub fn get_line_item_position(&self, position: f32) -> MapPosition
Get a map position related to a position on a transport line.
Sourcepub fn insert_at(
&self,
belt_stack_size: Option<u8>,
items: LuaAny,
position: f32,
) -> bool
pub fn insert_at( &self, belt_stack_size: Option<u8>, items: LuaAny, position: f32, ) -> bool
Insert items at a given position.
Sourcepub fn insert_at_back(&self, belt_stack_size: Option<u8>, items: LuaAny) -> bool
pub fn insert_at_back(&self, belt_stack_size: Option<u8>, items: LuaAny) -> bool
Insert items at the back of this line.
Sourcepub fn line_equals(&self, other: LuaTransportLine) -> bool
pub fn line_equals(&self, other: LuaTransportLine) -> bool
Returns whether the associated internal transport line of this line is the same as the others associated internal transport line.
This can return true even when the LuaTransportLine::owners are different (so this == other is false), because the internal transport lines can span multiple tiles.
Sourcepub fn remove_item(&self, items: LuaAny) -> u32
pub fn remove_item(&self, items: LuaAny) -> u32
Remove some items from this line.
Trait Implementations§
Source§impl Clone for LuaTransportLine
impl Clone for LuaTransportLine
Source§fn clone(&self) -> LuaTransportLine
fn clone(&self) -> LuaTransportLine
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more