pub struct LuaSpacePlatform;Expand description
A space platform.
Implementations§
Source§impl LuaSpacePlatform
impl LuaSpacePlatform
Sourcepub fn damaged_tiles(&self) -> Vec<LuaAny>
pub fn damaged_tiles(&self) -> Vec<LuaAny>
The damaged tiles on this platform.
Sourcepub fn distance(&self) -> f64
pub fn distance(&self) -> f64
The point on space connection this platform is at or nil.
It is represented as a number in range [0, 1], with 0 being LuaSpaceConnectionPrototype::from and 1 being LuaSpaceConnectionPrototype::to.
Sourcepub fn ejected_items(&self) -> Vec<EjectedItem>
pub fn ejected_items(&self) -> Vec<EjectedItem>
All items that have been thrown overboard.
If this platform is hidden from the remote view surface list.
Sourcepub fn last_visited_space_location(&self) -> LuaSpaceLocationPrototype
pub fn last_visited_space_location(&self) -> LuaSpaceLocationPrototype
The space location this space platform previously went through or stopped at.
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 paused(&self) -> bool
pub fn paused(&self) -> bool
When true, the platform has paused thrust and does not advance its schedule.
Sourcepub fn schedule(&self) -> PlatformSchedule
pub fn schedule(&self) -> PlatformSchedule
This platform’s current schedule, if any. Set to nil to clear.
The schedule can’t be changed by modifying the returned table. Instead, changes must be made by assigning a new table to this attribute.
This is a simplified schedule that does not include groups and interrupts. See LuaSpacePlatform::get_schedule for full access to the schedule, including interrupts and groups.
Sourcepub fn scheduled_for_deletion(&self) -> u32
pub fn scheduled_for_deletion(&self) -> u32
If this platform is scheduled for deletion.
Returns how many ticks are left before the platform will be deleted. 0 if not scheduled for deletion.
Sourcepub fn space_connection(&self) -> LuaSpaceConnectionPrototype
pub fn space_connection(&self) -> LuaSpaceConnectionPrototype
The space connection this space platform is traveling through or nil.
Write operation requires a valid space connection and it sets the distance to 0.5.
Sourcepub fn space_location(&self) -> LuaSpaceLocationPrototype
pub fn space_location(&self) -> LuaSpaceLocationPrototype
The space location this space platform is stopped at or nil.
Write operation requires a valid space location and will cancel pending item requests.
pub fn speed(&self) -> f64
Sourcepub fn starter_pack(&self) -> ItemIDAndQualityIDPair
pub fn starter_pack(&self) -> ItemIDAndQualityIDPair
The starter pack used to create this space platform.
Sourcepub fn surface(&self) -> LuaSurface
pub fn surface(&self) -> LuaSurface
The surface that belongs to this platform (if it has been created yet).
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 apply_starter_pack(&self, silent: Option<bool>) -> Option<LuaEntity>
pub fn apply_starter_pack(&self, silent: Option<bool>) -> Option<LuaEntity>
Applies the starter pack for this platform if it hasn’t already been applied.
Sourcepub fn can_leave_current_location(&self) -> bool
pub fn can_leave_current_location(&self) -> bool
Returns true when the space platform isn’t waiting on any delivery from the planet.
Sourcepub fn cancel_deletion(&self)
pub fn cancel_deletion(&self)
Cancels deletion of this space platform if it was scheduled for deletion.
Sourcepub fn clear_ejected_items(&self)
pub fn clear_ejected_items(&self)
Removes all ejected items from this space platform.
Sourcepub fn create_asteroid_chunks(&self, asteroid_chunks: Vec<AsteroidChunk>)
pub fn create_asteroid_chunks(&self, asteroid_chunks: Vec<AsteroidChunk>)
Creates the given asteroid chunks on this platform.
Sourcepub fn damage_tile(&self, params: LuaSpacePlatformDamageTileParams)
pub fn damage_tile(&self, params: LuaSpacePlatformDamageTileParams)
Damages the given tile if it exists, the chunk is generated, and it is a platform foundation tile.
Sourcepub fn destroy_asteroid_chunks(
&self,
params: LuaSpacePlatformDestroyAsteroidChunksParams,
) -> u32
pub fn destroy_asteroid_chunks( &self, params: LuaSpacePlatformDestroyAsteroidChunksParams, ) -> u32
Destroys all asteroid chunks from the given area. If no area and no position are given, then the entire surface is searched.
Sourcepub fn eject_item(&self, item: LuaAny, movement: Vector, position: MapPosition)
pub fn eject_item(&self, item: LuaAny, movement: Vector, position: MapPosition)
Ejects an item into space on this space platform.
If a LuaItemStack is provided, the actual item is ejected and removed from the source.
Sourcepub fn find_asteroid_chunks_filtered(
&self,
params: LuaSpacePlatformFindAsteroidChunksFilteredParams,
) -> Vec<AsteroidChunk>
pub fn find_asteroid_chunks_filtered( &self, params: LuaSpacePlatformFindAsteroidChunksFilteredParams, ) -> Vec<AsteroidChunk>
Find asteroid chunks of a given name in a given area.
If no filters are given, returns all asteroid chunks in the search area. If multiple filters are specified, returns only asteroid chunks matching every given filter. If no area and no position are given, the entire surface is searched.
Sourcepub fn get_schedule(&self) -> LuaSchedule
pub fn get_schedule(&self) -> LuaSchedule
This allows full access to the space platform schedule, including modifying the schedule records, the group and the interrupts.
Sourcepub fn repair_tile(&self, amount: Option<f32>, position: TilePosition)
pub fn repair_tile(&self, amount: Option<f32>, position: TilePosition)
Repairs the given tile if it’s damaged.
Trait Implementations§
Source§impl Clone for LuaSpacePlatform
impl Clone for LuaSpacePlatform
Source§fn clone(&self) -> LuaSpacePlatform
fn clone(&self) -> LuaSpacePlatform
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more