Struct landmass::Island

source ·
pub struct Island<CS: CoordinateSystem> { /* private fields */ }
Expand description

An Island in an Archipelago. Each island holds a navigation mesh.

Implementations§

source§

impl<CS: CoordinateSystem> Island<CS>

source

pub fn new( transform: Transform<CS>, nav_mesh: Arc<ValidNavigationMesh<CS>>, type_index_to_node_type: HashMap<usize, NodeType>, ) -> Self

Creates a new island. For details on the type_index_to_node_type argument, see Self::set_type_index_to_node_type.

source

pub fn get_transform(&self) -> &Transform<CS>

Gets the current transform of the island.

source

pub fn set_transform(&mut self, transform: Transform<CS>)

Sets the current transform of the island.

source

pub fn get_nav_mesh(&self) -> Arc<ValidNavigationMesh<CS>>

Gets the current navigation mesh used by the island.

source

pub fn set_nav_mesh(&mut self, nav_mesh: Arc<ValidNavigationMesh<CS>>)

Sets the navigation mesh of the island.

source

pub fn get_type_index_to_node_type(&self) -> &HashMap<usize, NodeType>

Gets the current type_index_to_node_type used by the island.

source

pub fn set_type_index_to_node_type( &mut self, type_index_to_node_type: HashMap<usize, NodeType>, )

Sets the “translation” from the type indices used in the navigation mesh into NodeTypes from the crate::Archipelago. Type indices without a corresponding node type will be treated as the “default” node type, which has a cost of 1.0. See crate::Archipelago::add_node_type for details on cost. NodeTypes not present in the corresponding crate::Archipelago will cause a panic, so do not mix NodeTypes across crate::Archipelagos.

Auto Trait Implementations§

§

impl<CS> Freeze for Island<CS>

§

impl<CS> RefUnwindSafe for Island<CS>

§

impl<CS> Send for Island<CS>
where <CS as CoordinateSystem>::Coordinate: Send, CS: Sync + Send,

§

impl<CS> Sync for Island<CS>
where <CS as CoordinateSystem>::Coordinate: Sync, CS: Sync + Send,

§

impl<CS> Unpin for Island<CS>

§

impl<CS> UnwindSafe for Island<CS>

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> 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

§

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>,

§

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.
source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

source§

fn is_within(&self, b: &G2) -> bool