Skip to main content

LuaPin

Struct LuaPin 

Source
pub struct LuaPin;
Expand description

A pin owned by a player.

Implementations§

Source§

impl LuaPin

Source

pub fn alert_positions(&self) -> Vec<MapPosition>

The alert positions if this pin is configured to show alert data.

Source

pub fn set_alert_positions(&self, value: Vec<MapPosition>)

Set the alert_positions attribute (Lua: self.alert_positions = value).

The alert positions if this pin is configured to show alert data.

Source

pub fn alert_type(&self) -> &'static str

The type of alert this pin is for (if configured to be about alerts).

Source

pub fn set_alert_type(&self, value: &'static str)

Set the alert_type attribute (Lua: self.alert_type = value).

The type of alert this pin is for (if configured to be about alerts).

Source

pub fn always_visible(&self) -> bool

Source

pub fn set_always_visible(&self, value: bool)

Set the always_visible attribute (Lua: self.always_visible = value).

Source

pub fn chart_tag(&self) -> LuaCustomChartTag

The custom chart tag - if this pin specificaly binds to a chart tag.

The chart tag must be on the same force as the owning player.

Source

pub fn set_chart_tag(&self, value: LuaCustomChartTag)

Set the chart_tag attribute (Lua: self.chart_tag = value).

The custom chart tag - if this pin specificaly binds to a chart tag.

The chart tag must be on the same force as the owning player.

Source

pub fn index(&self) -> u32

The index of this pin (unique to this player).

Note that this index has no corelation to the position of the pin within LuaPlayer::get_pins

Source

pub fn label(&self) -> &'static str

The label for this pin - if any. This will be an empty string if there is no label set.

Source

pub fn set_label(&self, value: &'static str)

Set the label attribute (Lua: self.label = value).

The label for this pin - if any. This will be an empty string if there is no label set.

Source

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.

Source

pub fn owner(&self) -> LuaPlayer

The player that this pin belongs to.

Source

pub fn player(&self) -> LuaPlayer

The player that this pin is bound to.

Source

pub fn set_player(&self, value: LuaPlayer)

Set the player attribute (Lua: self.player = value).

The player that this pin is bound to.

Source

pub fn position(&self) -> MapPosition

The position if this pin specifically binds to a surface and position.

If writing, and this pin was not bound to a specific surface and position, the default surface of nauvis is used.

Source

pub fn set_position(&self, value: MapPosition)

Set the position attribute (Lua: self.position = value).

The position if this pin specifically binds to a surface and position.

If writing, and this pin was not bound to a specific surface and position, the default surface of nauvis is used.

Source

pub fn preview_distance(&self) -> u16

The radius (in tiles) that is shown in the tooltip for this pin.

Source

pub fn set_preview_distance(&self, value: u16)

Set the preview_distance attribute (Lua: self.preview_distance = value).

The radius (in tiles) that is shown in the tooltip for this pin.

Source

pub fn surface_index(&self) -> u32

The surface index if this pin specifically binds to a surface and position.

If writing, and this pin was not bound to a specific surface and position, the default position of (0,0) is used.

Source

pub fn set_surface_index(&self, value: u32)

Set the surface_index attribute (Lua: self.surface_index = value).

The surface index if this pin specifically binds to a surface and position.

If writing, and this pin was not bound to a specific surface and position, the default position of (0,0) is used.

Source

pub fn targets(&self) -> Vec<LuaEntity>

The targets of this pin - if any.

Source

pub fn set_targets(&self, value: Vec<LuaEntity>)

Set the targets attribute (Lua: self.targets = value).

The targets of this pin - if any.

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 destroy(&self)

Destroys this pin.

Source

pub fn get_pin_center(&self) -> Option<MapPosition>

The center of this pin if it can be computed.

Trait Implementations§

Source§

impl Clone for LuaPin

Source§

fn clone(&self) -> LuaPin

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 LuaPin

Source§

impl Debug for LuaPin

Source§

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

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

impl Default for LuaPin

Source§

fn default() -> LuaPin

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

impl Eq for LuaPin

Source§

impl From<LuaPin> for LuaAny

Source§

fn from(_: LuaPin) -> Self

Converts to this type from the input type.
Source§

impl LuaObject for LuaPin

Source§

impl PartialEq for LuaPin

Source§

fn eq(&self, other: &LuaPin) -> 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 LuaPin

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.