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>
impl<CS: CoordinateSystem> Island<CS>
sourcepub fn new(
transform: Transform<CS>,
nav_mesh: Arc<ValidNavigationMesh<CS>>,
type_index_to_node_type: HashMap<usize, NodeType>,
) -> Self
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
.
sourcepub fn get_transform(&self) -> &Transform<CS>
pub fn get_transform(&self) -> &Transform<CS>
Gets the current transform of the island.
sourcepub fn set_transform(&mut self, transform: Transform<CS>)
pub fn set_transform(&mut self, transform: Transform<CS>)
Sets the current transform of the island.
Gets the current navigation mesh used by the island.
Sets the navigation mesh of the island.
sourcepub fn get_type_index_to_node_type(&self) -> &HashMap<usize, NodeType>
pub fn get_type_index_to_node_type(&self) -> &HashMap<usize, NodeType>
Gets the current type_index_to_node_type
used by the island.
sourcepub fn set_type_index_to_node_type(
&mut self,
type_index_to_node_type: HashMap<usize, NodeType>,
)
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 NodeType
s 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. NodeType
s not present in the corresponding
crate::Archipelago
will cause a panic, so do not mix NodeType
s
across crate::Archipelago
s.
Auto Trait Implementations§
impl<CS> Freeze for Island<CS>
impl<CS> RefUnwindSafe for Island<CS>
impl<CS> Send for Island<CS>
impl<CS> Sync for Island<CS>
impl<CS> Unpin for Island<CS>
impl<CS> UnwindSafe for Island<CS>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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