Skip to main content

LuaSurface

Struct LuaSurface 

Source
pub struct LuaSurface;
Expand description

A “domain” of the world, such as a planet or space platform. Surfaces are uniquely identified by their name. Every game contains at least the surface “nauvis”.

Implementations§

Source§

impl LuaSurface

Source

pub fn always_day(&self) -> bool

When set to true, the sun will always shine.

Source

pub fn brightness_visual_weights(&self) -> ColorModifier

Defines how surface daytime brightness influences each color channel of the current color lookup table (LUT).

The LUT is multiplied by ((1 - weight) + brightness * weight) and result is clamped to range [0, 1].

Default is {0, 0, 0}, which means no influence.

Source

pub fn darkness(&self) -> f32

Amount of darkness at the current time, as a number in range [0, 1].

Source

pub fn dawn(&self) -> f64

The daytime when dawn starts.

Source

pub fn daytime(&self) -> f64

Current time of day, as a number in range [0, 1).

Source

pub fn daytime_parameters(&self) -> LuaSurfaceDaytimeParameters

Parameters of daytime. Equivalent as reading dusk, evening, morning and dawn at the same time.

In order for a write to take place, a new table needs to be written in one go: changing individual members of the returned table has no effect as those are value copies.

Source

pub fn deletable(&self) -> bool

If this surface can be deleted.

Source

pub fn dusk(&self) -> f64

The daytime when dusk starts.

Source

pub fn evening(&self) -> f64

The daytime when evening starts.

Source

pub fn freeze_daytime(&self) -> bool

True if daytime is currently frozen.

Source

pub fn generate_with_lab_tiles(&self) -> bool

When set to true, new chunks will be generated with lab tiles, instead of using the surface’s map generation settings.

Source

pub fn global_effect(&self) -> ModuleEffects

Surface-wide effects applied to entities with effect receivers. nil if this surface is not using surface-wide effect source.

Source

pub fn global_electric_network(&self) -> LuaElectricSubNetwork

Global electric network for this surface.

Source

pub fn global_electric_network_statistics(&self) -> LuaFlowStatistics

The global electric network statistics for this surface.

If this global network is disabled or this surface is removed, the flow statistics obtained from it will also become invalid. However if the surface index of a deleted surface is reused, the related flow statistics may become valid again.

Source

pub fn has_global_electric_network(&self) -> bool

Whether this surface currently has a global electric network.

Source

pub fn ignore_surface_conditions(&self) -> bool

If surface condition checks should not be performed on this surface.

Source

pub fn index(&self) -> u32

This surface’s index in LuaGameScript::surfaces (unique ID). It is assigned when a surface is created, and remains so until it is deleted. Indexes of deleted surfaces can be reused.

Source

pub fn localised_name(&self) -> &str

Localised name of this surface. When set, will replace the internal surface name in places where a player sees surface name.

Value may be ignored if a surface has a SpacePlatform or Planet object attached to it, which take the precedence.

Source

pub fn map_gen_settings(&self) -> MapGenSettings

The generation settings for this surface. These can be modified after surface generation, but note that this will not retroactively update the surface. To manually regenerate it, LuaSurface::regenerate_entity, LuaSurface::regenerate_decorative, and LuaSurface::delete_chunk can be used.

Source

pub fn min_brightness(&self) -> f64

The minimal brightness during the night. Defaults to 0.15. This has an effect on both rendering and game mechanics such as biter spawns and solar power.

Source

pub fn morning(&self) -> f64

The daytime when morning starts.

Source

pub fn name(&self) -> &str

The name of this surface. Names are unique among surfaces.

The default surface can’t be renamed.

Source

pub fn no_enemies_mode(&self) -> bool

Is no-enemies mode enabled on this surface?

Source

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.

Source

pub fn override_pollution_type(&self) -> Pollutant

If set, this pollution type will be used over any other planet or platform values.

If set to an empty table, pollution is disabled. If set to nil, the override is ‘unset’.

Reading will be nil if unset or a table with the current override (nil if overridden to disabled).

Source

pub fn peaceful_mode(&self) -> bool

Is peaceful mode enabled on this surface?

Source

pub fn planet(&self) -> LuaPlanet

The planet associated with this surface, if there is one.

Use LuaPlanet::associate_surface to create a new association with a planet.

Source

pub fn platform(&self) -> LuaSpacePlatform

Source

pub fn pollutant_type(&self) -> LuaAirbornePollutantPrototype

The type of pollutant enabled on the surface, or nil if no pollutant is enabled.

Source

pub fn pollution_statistics(&self) -> LuaFlowStatistics

The pollution statistics for this surface.

Source

pub fn show_clouds(&self) -> bool

If clouds are shown on this surface. If false, clouds are never shown. If true the player must also have clouds enabled in graphics settings for them to be shown.

By default, clouds are shown on all surfaces.

Source

pub fn solar_power_multiplier(&self) -> f64

The multiplier of solar power on this surface. Cannot be less than 0.

Source

pub fn ticks_per_day(&self) -> u32

The number of ticks per day for this surface.

Source

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.

Source

pub fn wind_orientation(&self) -> LuaAny

Current wind direction.

Source

pub fn wind_orientation_change(&self) -> f64

Change in wind orientation per tick.

Source

pub fn wind_speed(&self) -> f64

Current wind speed in tiles per tick.

Source

pub fn add_script_area(&self, area: ScriptArea) -> u32

Adds the given script area.

Source

pub fn add_script_position(&self, position: ScriptPosition) -> u32

Adds the given script position.

Source

pub fn build_checkerboard(&self, area: BoundingBox)

Sets the given area to the checkerboard lab tiles.

Source

pub fn build_enemy_base( &self, force: Option<LuaAny>, position: MapPosition, unit_count: u32, )

Send a group to build a new base.

The specified force must be AI-controlled; i.e. force.ai_controllable must be true.

Source

pub fn calculate_tile_properties( &self, positions: Vec<MapPosition>, property_names: Vec<&str>, ) -> HashMap<String, Vec<f64>>

Calculate values for a list of tile properties at a list of positions. Requests for unrecognized properties will be ignored, so this can also be used to test whether those properties exist.

Source

pub fn can_fast_replace(&self, params: LuaSurfaceCanFastReplaceParams) -> bool

If there exists an entity at the given location that can be fast-replaced with the given entity parameters.

Source

pub fn can_place_entity(&self, params: LuaSurfaceCanPlaceEntityParams) -> bool

Check for collisions with terrain or other entities.

Source

pub fn cancel_deconstruct_area( &self, params: LuaSurfaceCancelDeconstructAreaParams, )

Cancel a deconstruction order.

Source

pub fn cancel_upgrade_area(&self, params: LuaSurfaceCancelUpgradeAreaParams)

Cancel a upgrade order.

Source

pub fn clear(&self, ignore_characters: Option<bool>)

Clears this surface deleting all entities and chunks on it.

Source

pub fn clear_hidden_tiles(&self)

Completely removes hidden and double hidden tiles data on this surface.

Source

pub fn clear_pollution(&self)

Clears all pollution on this surface.

Source

pub fn clear_territory_for_chunks(&self, chunk_positions: Vec<ChunkPosition>)

Removes the chunk from the territory it is associated with (if any) and allows the map generator to potentially generate a new territory for the chunk in the future. To prevent the game from generating a new territory for the chunk, use LuaSurface::set_chunk_territory to set the chunk’s territory to nil.

Territories that do not contain at least one generated chunk as a result of calling this method will be automatically deleted.

Source

pub fn clone_area(&self, params: LuaSurfaceCloneAreaParams)

Clones the given area.

Entities are cloned in an order such that they can always be created, eg rails before trains.

Source

pub fn clone_brush(&self, params: LuaSurfaceCloneBrushParams)

Clones the given area.

defines.events.on_entity_cloned is raised for each entity, and then defines.events.on_area_cloned is raised.

Entities are cloned in an order such that they can always be created, eg rails before trains.

Source

pub fn clone_entities(&self, params: LuaSurfaceCloneEntitiesParams)

Clones the given entities.

Entities are cloned in an order such that they can always be created, eg rails before trains.

Source

pub fn count_entities_filtered(&self, filter: EntitySearchFilters) -> u32

Count entities of given type or name in a given area. Works just like LuaSurface::find_entities_filtered, except this only returns the count. As it doesn’t construct all the wrapper objects, this is more efficient if one is only interested in the number of entities.

  • If no area or position are given, the entire surface is searched.

  • If position is given, this returns the entities colliding with that position (i.e the given position is within the entity’s collision box).

  • If position and radius are given, this returns entities in the radius of the position.

  • If area is specified, this returns entities colliding with that area.

Source

pub fn count_tiles_filtered(&self, filter: TileSearchFilters) -> u32

Count tiles of a given name in a given area. Works just like LuaSurface::find_tiles_filtered, except this only returns the count. As it doesn’t construct all the wrapper objects, this is more efficient if one is only interested in the number of tiles.

If no area or position and radius is given, the entire surface is searched. If position and radius are given, only tiles within the radius of the position are included.

Source

pub fn create_decoratives(&self, params: LuaSurfaceCreateDecorativesParams)

Adds the given decoratives to the surface.

This will merge decoratives of the same type that already exist effectively increasing the “amount” field.

Source

pub fn create_entities_from_blueprint_string( &self, params: LuaSurfaceCreateEntitiesFromBlueprintStringParams, ) -> Option<i32>

This method only works when used in simulations.

Places entities via the given blueprint string. These entities are force-built.

Source

pub fn create_entity( &self, params: LuaSurfaceCreateEntityParams, ) -> Option<LuaEntity>

Create an entity on this surface.

Source

pub fn create_global_electric_network(&self)

Creates a global electric network for this surface, if one doesn’t exist already.

Source

pub fn create_particle(&self, params: LuaSurfaceCreateParticleParams)

Creates a particle at the given location

Source

pub fn create_segmented_unit( &self, params: LuaSurfaceCreateSegmentedUnitParams, ) -> Option<LuaSegmentedUnit>

Create a segmented unit on the surface. This differs from creating an entity with type "segmented-unit" in that this method can create the entity in non-generated chunks and with any arbitrary body shape and pre-assigned to a territory.

Source

pub fn create_territory( &self, params: LuaSurfaceCreateTerritoryParams, ) -> Option<LuaTerritory>

Create a territory on the surface.

Source

pub fn create_trivial_smoke(&self, params: LuaSurfaceCreateTrivialSmokeParams)

Source

pub fn create_unit_group( &self, params: LuaSurfaceCreateUnitGroupParams, ) -> LuaCommandable

Create a new unit group at a given position.

Source

pub fn deconstruct_area(&self, params: LuaSurfaceDeconstructAreaParams)

Place a deconstruction request.

Source

pub fn decorative_prototype_collides( &self, position: MapPosition, prototype: LuaAny, ) -> bool

Whether the given decorative prototype collides at the given position and direction.

Source

pub fn delete_chunk(&self, chunk_position: ChunkPosition)

Source

pub fn destroy_decoratives(&self, params: LuaSurfaceDestroyDecorativesParams)

Removes all decoratives from the given area. If no area and no position are given, then the entire surface is searched.

Source

pub fn destroy_global_electric_network(&self)

Destroys the global electric network for this surface, if it exists.

Source

pub fn edit_script_area(&self, area: ScriptArea, id: u32)

Sets the given script area to the new values.

Source

pub fn edit_script_position(&self, id: u32, position: ScriptPosition)

Sets the given script position to the new values.

Source

pub fn entity_prototype_collides( &self, direction: Option<&str>, position: MapPosition, prototype: LuaAny, use_map_generation_bounding_box: bool, ) -> bool

Whether the given entity prototype collides at the given position and direction.

Source

pub fn execute_lightning(&self, params: LuaSurfaceExecuteLightningParams)

Creates lightning. If other entities which can be lightning targets are nearby, the final position will be adjusted.

Source

pub fn find_closest_logistic_network_by_position( &self, force: LuaAny, position: MapPosition, ) -> Option<LuaLogisticNetwork>

Find the logistic network with a cell closest to a given position.

Source

pub fn find_decoratives_filtered( &self, params: LuaSurfaceFindDecorativesFilteredParams, ) -> Vec<DecorativeResult>

Find decoratives of a given name in a given area.

If no filters are given, returns all decoratives in the search area. If multiple filters are specified, returns only decoratives matching every given filter. If no area and no position are given, the entire surface is searched.

Source

pub fn find_enemy_units( &self, center: MapPosition, force: Option<LuaAny>, radius: f64, ) -> Vec<LuaEntity>

Find enemy units (entities with type “unit”) of a given force within an area.

This is more efficient than LuaSurface::find_entities.

Source

pub fn find_entities(&self, area: Option<BoundingBox>) -> Vec<LuaEntity>

Find entities in a given area.

If no area is given all entities on the surface are returned.

Source

pub fn find_entities_filtered( &self, filter: EntitySearchFilters, ) -> Vec<LuaEntity>

Find all entities of the given type or name in the given area.

If no filters (name, type, force, etc.) are given, this returns all entities in the search area. If multiple filters are specified, only entities matching all given filters are returned.

  • If no area or position are given, the entire surface is searched.

  • If position is given, this returns the entities colliding with that position (i.e the given position is within the entity’s collision box).

  • If position and radius are given, this returns the entities within the radius of the position. Looks for the center of entities.

  • If area is specified, this returns the entities colliding with that area.

Source

pub fn find_entity( &self, entity: LuaAny, position: MapPosition, ) -> Option<LuaEntity>

Find an entity of the given name at the given position. This checks both the exact position and the bounding box of the entity.

Source

pub fn find_logistic_network_by_position( &self, force: LuaAny, position: MapPosition, ) -> Option<LuaLogisticNetwork>

Find the logistic network that covers a given position.

Source

pub fn find_logistic_networks_by_construction_area( &self, force: LuaAny, position: MapPosition, ) -> Vec<LuaLogisticNetwork>

Finds all of the logistics networks whose construction area intersects with the given position.

Source

pub fn find_nearest_enemy( &self, params: LuaSurfaceFindNearestEnemyParams, ) -> Option<LuaEntity>

Find the enemy military target (military entity) closest to the given position.

Source

pub fn find_nearest_enemy_entity_with_owner( &self, params: LuaSurfaceFindNearestEnemyEntityWithOwnerParams, ) -> LuaEntity

Find the enemy entity-with-owner closest to the given position.

Source

pub fn find_non_colliding_position( &self, center: MapPosition, force_to_tile_center: Option<bool>, name: LuaAny, precision: f64, radius: f64, ) -> Option<MapPosition>

Find a non-colliding position within a given radius.

Special care needs to be taken when using a radius of 0. The game will not stop searching until it finds a suitable position, so it is important to make sure such a position exists. One particular case where it would not be able to find a solution is running it before any chunks have been generated.

Source

pub fn find_non_colliding_position_in_box( &self, force_to_tile_center: Option<bool>, name: LuaAny, precision: f64, search_space: BoundingBox, ) -> Option<MapPosition>

Find a non-colliding position within a given rectangle.

Source

pub fn find_tiles_filtered(&self, filter: TileSearchFilters) -> Vec<LuaTile>

Find all tiles of the given name in the given area.

If no filters are given, this returns all tiles in the search area.

If no area or position and radius is given, the entire surface is searched. If position and radius are given, only tiles within the radius of the position are included.

Source

pub fn find_units(&self, params: LuaSurfaceFindUnitsParams) -> Vec<LuaEntity>

Find units (entities with type “unit”) of a given force and force condition within a given area.

This is more efficient than LuaSurface::find_entities.

Source

pub fn force_generate_chunk_requests(&self)

Blocks and generates all chunks that have been requested using all available threads.

Source

pub fn get_chunks(&self) -> LuaChunkIterator

Get an iterator going over every chunk on this surface.

Chunks may or may not be generated; use LuaSurface::is_chunk_generated to check a chunk’s state before accessing it.

Source

pub fn get_closest( &self, entities: Vec<LuaEntity>, position: MapPosition, ) -> Option<LuaEntity>

Gets the closest entity in the list to this position.

Source

pub fn get_connected_tiles( &self, area: Option<BoundingBox>, include_diagonal: Option<bool>, position: TilePosition, tiles: Vec<LuaAny>, ) -> Vec<TilePosition>

Gets all tiles of the given types that are connected horizontally or vertically to the given tile position including the given tile position.

This won’t find tiles in non-generated chunks.

Source

pub fn get_default_cover_tile( &self, force: LuaAny, tile: LuaAny, ) -> Option<LuaTilePrototype>

Gets the cover tile for the given force and tile on this surface if one is set.

Source

pub fn get_double_hidden_tile(&self, position: TilePosition) -> &str

The double hidden tile name or nil if there isn’t one for the given position.

Source

pub fn get_entities_with_force( &self, chunk_position: ChunkPosition, force: LuaAny, ) -> Vec<LuaEntity>

Returns all the military targets (entities with force) on this chunk for the given force.

Source

pub fn get_hidden_tile(&self, position: TilePosition) -> Option<&str>

The hidden tile name.

Source

pub fn get_map_exchange_string(&self) -> &str

Gets the map exchange string for the current map generation settings of this surface.

Source

pub fn get_pollution(&self, position: MapPosition) -> f64

Get the pollution for a given position.

Pollution is stored per chunk, so this will return the same value for all positions in one chunk.

Source

pub fn get_property(&self, property: LuaAny) -> f64

Gets the value of surface property on this surface.

Source

pub fn get_random_chunk(&self) -> Option<ChunkPosition>

Gets a random generated chunk position or nil if no chunks have been generated on this surface.

Source

pub fn get_resource_counts(&self) -> HashMap<String, u32>

Gets the resource amount of all resources on this surface

Source

pub fn get_script_area(&self, key: Option<LuaAny>) -> Option<ScriptArea>

Gets the first script area by name or id.

Source

pub fn get_script_areas(&self, name: Option<&str>) -> Vec<ScriptArea>

Gets the script areas that match the given name or if no name is given all areas are returned.

Source

pub fn get_script_position(&self, key: Option<LuaAny>) -> Option<ScriptPosition>

Gets the first script position by name or id.

Source

pub fn get_script_positions(&self, name: Option<&str>) -> Vec<ScriptPosition>

Gets the script positions that match the given name or if no name is given all positions are returned.

Source

pub fn get_segmented_units(&self) -> Vec<LuaSegmentedUnit>

Get all segmented units that exist on the surface.

Source

pub fn get_starting_area_radius(&self) -> f64

Gets the starting area radius of this surface.

Source

pub fn get_territories(&self) -> Vec<LuaTerritory>

Get all territories on the surface.

Source

pub fn get_territory_for_chunk( &self, chunk_position: ChunkPosition, ) -> Option<LuaTerritory>

Get the territory that the given chunk is assigned to. If the chunk is not part of any territory or the territory for the chunk has not yet been generated, then this returns nil.

Source

pub fn get_tile(&self, x: i32, y: i32) -> LuaTile

Get the tile at a given position. An alternative call signature for this method is passing it a single TilePosition.

Non-integer values will result in them being rounded down.

Source

pub fn get_total_pollution(&self) -> f64

Gets the total amount of pollution on the surface by iterating over all the chunks containing pollution.

Source

pub fn is_chunk_generated(&self, chunk_position: ChunkPosition) -> bool

Is a given chunk generated?

Source

pub fn play_music(&self, music_specification: PlayMusicSpecification)

Play a music track for every player on this surface.

Source

pub fn play_sound(&self, sound_specification: PlaySoundSpecification)

Play a sound for every player on this surface.

The sound is not played if its location is not charted for that player.

Source

pub fn pollute( &self, amount: f64, prototype: Option<LuaAny>, source: MapPosition, )

Spawn pollution at the given position.

Source

pub fn print(&self, message: &str, print_settings: Option<PrintSettings>)

Print text to the chat console of all players on this surface.

By default, messages that are identical to a message sent in the last 60 ticks are not printed again.

Source

pub fn regenerate_decorative( &self, chunks: Option<Vec<ChunkPosition>>, decoratives: Option<LuaAny>, )

Regenerate autoplacement of some decoratives on this surface. This can be used to autoplace newly-added decoratives.

All specified decorative prototypes must be autoplacable. If nothing is given all decoratives are generated on all chunks.

Source

pub fn regenerate_entity( &self, chunks: Option<Vec<ChunkPosition>>, entities: Option<LuaAny>, )

Regenerate autoplacement of some entities on this surface. This can be used to autoplace newly-added entities.

All specified entity prototypes must be autoplacable. If nothing is given all entities are generated on all chunks.

Source

pub fn remove_script_area(&self, id: u32) -> bool

Removes the given script area.

Source

pub fn remove_script_position(&self, id: u32) -> bool

Removes the given script position.

Source

pub fn request_path(&self, params: LuaSurfaceRequestPathParams) -> u32

Generates a path with the specified constraints (as an array of PathfinderWaypoints) using the unit pathfinding algorithm. This path can be used to emulate pathing behavior by script for non-unit entities, such as vehicles. If you want to command actual units (such as biters or spitters) to move, use LuaCommandable::set_command via LuaEntity::commandable instead.

The resulting path is ultimately returned asynchronously via on_script_path_request_finished.

Source

pub fn request_to_generate_chunks( &self, position: MapPosition, radius: Option<u32>, )

Request that the game’s map generator generate chunks at the given position for the given radius on this surface. If the radius is 0, then only the chunk at the given position is generated.

Source

pub fn set_chunk_generated_status( &self, chunk_position: ChunkPosition, status: &str, )

Set generated status of a chunk. Useful when copying chunks.

Source

pub fn set_default_cover_tile( &self, force: LuaAny, from_tile: LuaAny, to_tile: Option<LuaAny>, )

Sets the cover tile for the given force and tile on this surface.

Source

pub fn set_double_hidden_tile( &self, position: TilePosition, tile: Option<LuaAny>, )

Set double hidden tile for the specified position. During normal gameplay, only non-mineable tiles can become double hidden.

Does nothing if hidden tile at specified position does not exist.

Source

pub fn set_hidden_tile(&self, position: TilePosition, tile: Option<LuaAny>)

Set the hidden tile for the specified position. While during normal gameplay only non-mineable or foundation tiles can become hidden, this method allows any kind of tile to be set as the hidden one.

Source

pub fn set_multi_command(&self, params: LuaSurfaceSetMultiCommandParams) -> u32

Give a command to multiple units. This will automatically select suitable units for the task.

Source

pub fn set_pollution(&self, amount: f64, position: MapPosition)

Set the pollution for a given position.

Pollution changes by this are not included in pollution statistics and do not affect evolution factors (as opposed to LuaSurface::pollute).

Source

pub fn set_property(&self, property: LuaAny, value: f64)

Sets the value of surface property on this surface.

Source

pub fn set_territory_for_chunks( &self, chunk_positions: Vec<ChunkPosition>, territory: Option<LuaTerritory>, )

Removes the given chunks from their current territories and adds them to the given territory if provided.

This does not affect the LuaTerritory::get_patrol_path. It is your responsibility to update the patrol path if needed.

It’s recommended that territory chunks are connected to each other, but this is not required.

Territories that do not contain at least one generated chunk as a result of calling this method will be automatically deleted.

Source

pub fn set_tiles( &self, correct_tiles: Option<bool>, player: Option<LuaAny>, raise_event: Option<bool>, remove_colliding_decoratives: Option<bool>, remove_colliding_entities: Option<LuaAny>, tiles: Vec<Tile>, undo_index: Option<u32>, )

Set tiles at specified locations. Can automatically correct the edges around modified tiles.

Placing a mineable tile on top of a non-mineable or foundation one will turn the latter into the LuaTile::hidden_tile for that tile. Placing a mineable non-foundation tile on a mineable non-foundation one or a mineable foundation tile on a mineable foundation one will not modify the hidden tile. This restriction can however be circumvented by using LuaSurface::set_hidden_tile. Placing a non-foundation tile on top of a foundation one when there already exists a hidden tile will push hidden tile to double hidden, and foundation tile will turn into hidden. Placing a mineable foundation tile over a mineable non-foundation tile with hidden mineable foundation tile, the hidden tile will be replaced by previously double hidden tile and double hidden tile will be erased. Placing a non-mineable tile will erase hidden and double hidden tiles.

It is recommended to call this method once for all the tiles you want to change rather than calling it individually for every tile. As the tile correction is used after every step, calling it one by one could cause the tile correction logic to redo some of the changes. Also, many small API calls are generally more performance intensive than one big one.

Source

pub fn spill_inventory( &self, params: LuaSurfaceSpillInventoryParams, ) -> Vec<LuaEntity>

Spill inventory on the ground centered at a given location.

Source

pub fn spill_item_stack( &self, params: LuaSurfaceSpillItemStackParams, ) -> Vec<LuaEntity>

Spill items on the ground centered at a given location.

Source

pub fn upgrade_area(&self, params: LuaSurfaceUpgradeAreaParams)

Place an upgrade request.

Trait Implementations§

Source§

impl Clone for LuaSurface

Source§

fn clone(&self) -> LuaSurface

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LuaSurface

Source§

impl Debug for LuaSurface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LuaSurface

Source§

fn default() -> LuaSurface

Returns the “default value” for a type. Read more
Source§

impl Eq for LuaSurface

Source§

impl From<LuaSurface> for LuaAny

Source§

fn from(_: LuaSurface) -> Self

Converts to this type from the input type.
Source§

impl LuaObject for LuaSurface

Source§

impl PartialEq for LuaSurface

Source§

fn eq(&self, other: &LuaSurface) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LuaSurface

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.