pub struct LargeCostMatrix { /* private fields */ }
Expand description
A matrix of pathing costs for a room, stored in Rust memory. Stores
u16 values, so it can hold significantly more data in any particular
position compared to the default CostMatrix
.
Implementations§
Source§impl LargeCostMatrix
impl LargeCostMatrix
pub const fn new() -> Self
pub const fn new_with_default(default: u16) -> Self
pub fn set(&mut self, xy: RoomXY, val: u16)
pub fn get(&self, xy: RoomXY) -> u16
pub const fn get_bits(&self) -> &[u16; 2500]
pub fn iter(&self) -> impl Iterator<Item = (RoomXY, u16)> + '_
pub fn iter_mut(&mut self) -> impl Iterator<Item = (RoomXY, &mut u16)>
Trait Implementations§
Source§impl Clone for LargeCostMatrix
impl Clone for LargeCostMatrix
Source§fn clone(&self) -> LargeCostMatrix
fn clone(&self) -> LargeCostMatrix
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl CostMatrixGet for LargeCostMatrix
impl CostMatrixGet for LargeCostMatrix
Source§impl CostMatrixSet for LargeCostMatrix
impl CostMatrixSet for LargeCostMatrix
Source§impl Debug for LargeCostMatrix
impl Debug for LargeCostMatrix
Source§impl Default for LargeCostMatrix
impl Default for LargeCostMatrix
Source§impl<'de> Deserialize<'de> for LargeCostMatrix
impl<'de> Deserialize<'de> for LargeCostMatrix
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&CostMatrix> for LargeCostMatrix
impl From<&CostMatrix> for LargeCostMatrix
Source§fn from(js_matrix: &CostMatrix) -> Self
fn from(js_matrix: &CostMatrix) -> Self
Converts to this type from the input type.
Source§impl From<&LargeCostMatrix> for LocalCostMatrix
impl From<&LargeCostMatrix> for LocalCostMatrix
Source§fn from(lcm: &LargeCostMatrix) -> LocalCostMatrix
fn from(lcm: &LargeCostMatrix) -> LocalCostMatrix
Converts to this type from the input type.
Source§impl From<LargeCostMatrix> for CostMatrix
impl From<LargeCostMatrix> for CostMatrix
Source§fn from(lcm: LargeCostMatrix) -> CostMatrix
fn from(lcm: LargeCostMatrix) -> CostMatrix
Converts to this type from the input type.
Source§impl From<LargeCostMatrix> for LocalCostMatrix
impl From<LargeCostMatrix> for LocalCostMatrix
Source§fn from(lcm: LargeCostMatrix) -> LocalCostMatrix
fn from(lcm: LargeCostMatrix) -> LocalCostMatrix
Converts to this type from the input type.
Source§impl Index<Position> for LargeCostMatrix
impl Index<Position> for LargeCostMatrix
Source§impl Index<RoomXY> for LargeCostMatrix
impl Index<RoomXY> for LargeCostMatrix
Source§impl IndexMut<Position> for LargeCostMatrix
impl IndexMut<Position> for LargeCostMatrix
Source§impl IndexMut<RoomXY> for LargeCostMatrix
impl IndexMut<RoomXY> for LargeCostMatrix
Source§impl PartialEq for LargeCostMatrix
impl PartialEq for LargeCostMatrix
Source§impl Serialize for LargeCostMatrix
impl Serialize for LargeCostMatrix
impl Eq for LargeCostMatrix
impl StructuralPartialEq for LargeCostMatrix
Auto Trait Implementations§
impl Freeze for LargeCostMatrix
impl RefUnwindSafe for LargeCostMatrix
impl Send for LargeCostMatrix
impl Sync for LargeCostMatrix
impl Unpin for LargeCostMatrix
impl UnwindSafe for LargeCostMatrix
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
Mutably borrows from an owned value. Read more