pub struct LuaPlanet;Expand description
The runtime values of a planet
Implementations§
Source§impl LuaPlanet
impl LuaPlanet
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.
pub fn prototype(&self) -> LuaSpaceLocationPrototype
Sourcepub fn surface(&self) -> LuaSurface
pub fn surface(&self) -> LuaSurface
The surface for this planet if one currently exists.
Planets do not default generate their surface. LuaPlanet::create_surface can be used to force the surface to exist.
LuaPlanet::associate_surface can be used to create an association with an existing surface.
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 associate_surface(&self, surface: LuaAny)
pub fn associate_surface(&self, surface: LuaAny)
Associates the given surface with this planet. Surface must not already be associated with a planet and the planet must not already have an associated surface.
Planet must not be using entities_require_heating.
Sourcepub fn create_surface(&self) -> LuaSurface
pub fn create_surface(&self) -> LuaSurface
Creates the associated surface if one doesn’t already exist.
Sourcepub fn get_space_platforms(&self, force: LuaAny) -> Vec<LuaSpacePlatform>
pub fn get_space_platforms(&self, force: LuaAny) -> Vec<LuaSpacePlatform>
Gets the built space platforms orbiting this planet on the given force.
Note, this does not include platforms that have not yet been built.
Sourcepub fn reset_map_gen_settings(&self)
pub fn reset_map_gen_settings(&self)
Resets the map gen settings on this planet to the default from-prototype state.