pub struct LuaEquipmentGrid;Expand description
An equipment grid is for example the inside of a power armor.
Implementations§
Source§impl LuaEquipmentGrid
impl LuaEquipmentGrid
Sourcepub fn available_in_batteries(&self) -> f64
pub fn available_in_batteries(&self) -> f64
The total energy stored in all batteries in the equipment grid.
Sourcepub fn battery_capacity(&self) -> f64
pub fn battery_capacity(&self) -> f64
Total energy storage capacity of all batteries in the equipment grid.
Sourcepub fn entity_owner(&self) -> LuaEntity
pub fn entity_owner(&self) -> LuaEntity
The entity that this equipment grid is owned by (in some inventory or item stack.)
If the owning entity is a character owned by some player and the player is disconnected this will return nil.
Sourcepub fn equipment(&self) -> Vec<LuaEquipment>
pub fn equipment(&self) -> Vec<LuaEquipment>
All the equipment in this grid.
Sourcepub fn inhibit_movement_bonus(&self) -> bool
pub fn inhibit_movement_bonus(&self) -> bool
Whether this grid’s equipment movement bonus is active.
Sourcepub fn inventory_bonus(&self) -> u32
pub fn inventory_bonus(&self) -> u32
The total amount of inventory bonus this equipment grid gives.
Sourcepub fn itemstack_owner(&self) -> LuaItemStack
pub fn itemstack_owner(&self) -> LuaItemStack
The item stack that this equipment grid is owned by.
Sourcepub fn max_shield(&self) -> f32
pub fn max_shield(&self) -> f32
The maximum amount of shield hitpoints this equipment grid has across all shield equipment.
Sourcepub fn max_solar_energy(&self) -> f64
pub fn max_solar_energy(&self) -> f64
Maximum energy per tick that can be created by all solar panels in the equipment grid on the current surface. Actual generated energy varies depending on the daylight levels.
Sourcepub fn movement_bonus(&self) -> f64
pub fn movement_bonus(&self) -> f64
The total amount of movement bonus this equipment grid gives.
Returns 0 if LuaEquipmentGrid::inhibit_movement_bonus is true.
Sourcepub fn object_name(&self) -> &'static str
pub fn object_name(&self) -> &'static 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 player_owner(&self) -> LuaPlayer
pub fn player_owner(&self) -> LuaPlayer
The player that this equipment grid is owned by (in some inventory or item stack.)
pub fn prototype(&self) -> LuaEquipmentGridPrototype
Sourcepub fn shield(&self) -> f32
pub fn shield(&self) -> f32
The amount of shield hitpoints this equipment grid currently has across all shield equipment.
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_move(&self, params: LuaEquipmentGridCanMoveParams) -> bool
pub fn can_move(&self, params: LuaEquipmentGridCanMoveParams) -> bool
Check whether moving an equipment would succeed.
Sourcepub fn cancel_removal(&self, equipment: LuaEquipment) -> bool
pub fn cancel_removal(&self, equipment: LuaEquipment) -> bool
Cancels removal for the given equipment.
Sourcepub fn clear(&self, by_player: Option<PlayerIdentification>)
pub fn clear(&self, by_player: Option<PlayerIdentification>)
Clear all equipment from the grid, removing it without actually returning it.
Sourcepub fn count(&self, equipment: Option<EquipmentWithQualityID>) -> u32
pub fn count(&self, equipment: Option<EquipmentWithQualityID>) -> u32
Get the number of all or some equipment in this grid.
Sourcepub fn find(
&self,
equipment: EquipmentWithQualityID,
search_ghosts: Option<bool>,
) -> Option<LuaEquipment>
pub fn find( &self, equipment: EquipmentWithQualityID, search_ghosts: Option<bool>, ) -> Option<LuaEquipment>
Find equipment by name.
Sourcepub fn get(&self, position: EquipmentPosition) -> Option<LuaEquipment>
pub fn get(&self, position: EquipmentPosition) -> Option<LuaEquipment>
Find equipment in the Equipment Grid colliding with this position.
Sourcepub fn get_contents(&self) -> Vec<EquipmentWithQualityCounts>
pub fn get_contents(&self) -> Vec<EquipmentWithQualityCounts>
Get counts of all equipment in this grid.
Sourcepub fn get_generator_energy(&self, quality: Option<QualityID>) -> f64
pub fn get_generator_energy(&self, quality: Option<QualityID>) -> f64
Total energy per tick generated by the equipment inside this grid.
Sourcepub fn move(&self, params: LuaEquipmentGridMoveParams) -> bool
pub fn move(&self, params: LuaEquipmentGridMoveParams) -> bool
Move an equipment within this grid.
Sourcepub fn order_removal(&self, equipment: LuaEquipment) -> bool
pub fn order_removal(&self, equipment: LuaEquipment) -> bool
Marks the given equipment for removal. If the given equipment is a ghost it is removed.
Sourcepub fn put(&self, params: LuaEquipmentGridPutParams) -> Option<LuaEquipment>
pub fn put(&self, params: LuaEquipmentGridPutParams) -> Option<LuaEquipment>
Insert an equipment into the grid.
Sourcepub fn revive(&self, equipment: LuaEquipment) -> LuaEquipment
pub fn revive(&self, equipment: LuaEquipment) -> LuaEquipment
Revives the given equipment ghost if possible.
Sourcepub fn take(
&self,
params: LuaEquipmentGridTakeParams,
) -> Option<ItemWithQualityCount>
pub fn take( &self, params: LuaEquipmentGridTakeParams, ) -> Option<ItemWithQualityCount>
Remove an equipment from the grid.
Sourcepub fn take_all(
&self,
by_player: Option<PlayerIdentification>,
) -> Vec<ItemWithQualityCount>
pub fn take_all( &self, by_player: Option<PlayerIdentification>, ) -> Vec<ItemWithQualityCount>
Remove all equipment from the grid.
Trait Implementations§
Source§impl Clone for LuaEquipmentGrid
impl Clone for LuaEquipmentGrid
Source§fn clone(&self) -> LuaEquipmentGrid
fn clone(&self) -> LuaEquipmentGrid
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more