Struct screeps::local::LocalCostMatrix
source · pub struct LocalCostMatrix { /* private fields */ }
Expand description
A matrix of pathing costs for a room, stored in Rust memory.
Use CostMatrix
if a reference to data stored in JavaScript memory is
preferred.
Implementations§
source§impl LocalCostMatrix
impl LocalCostMatrix
pub const fn new() -> Self
pub fn set(&mut self, xy: RoomXY, val: u8)
pub fn get(&self, xy: RoomXY) -> u8
pub const fn get_bits(&self) -> &[u8; 2500]
pub fn iter(&self) -> impl Iterator<Item = (RoomXY, u8)> + '_
pub fn iter_mut(&mut self) -> impl Iterator<Item = (RoomXY, &mut u8)>
Trait Implementations§
source§impl Clone for LocalCostMatrix
impl Clone for LocalCostMatrix
source§fn clone(&self) -> LocalCostMatrix
fn clone(&self) -> LocalCostMatrix
Returns a copy 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 LocalCostMatrix
impl CostMatrixGet for LocalCostMatrix
source§impl CostMatrixSet for LocalCostMatrix
impl CostMatrixSet for LocalCostMatrix
source§impl Debug for LocalCostMatrix
impl Debug for LocalCostMatrix
source§impl Default for LocalCostMatrix
impl Default for LocalCostMatrix
source§impl<'de> Deserialize<'de> for LocalCostMatrix
impl<'de> Deserialize<'de> for LocalCostMatrix
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 LocalCostMatrix
impl From<&CostMatrix> for LocalCostMatrix
source§fn from(js_matrix: &CostMatrix) -> Self
fn from(js_matrix: &CostMatrix) -> Self
Converts to this type from the input type.
source§impl From<LocalCostMatrix> for CostMatrix
impl From<LocalCostMatrix> for CostMatrix
source§fn from(matrix: LocalCostMatrix) -> Self
fn from(matrix: LocalCostMatrix) -> Self
Converts to this type from the input type.
source§impl Index<Position> for LocalCostMatrix
impl Index<Position> for LocalCostMatrix
source§impl Index<RoomXY> for LocalCostMatrix
impl Index<RoomXY> for LocalCostMatrix
source§impl IndexMut<Position> for LocalCostMatrix
impl IndexMut<Position> for LocalCostMatrix
source§impl IndexMut<RoomXY> for LocalCostMatrix
impl IndexMut<RoomXY> for LocalCostMatrix
source§impl PartialEq for LocalCostMatrix
impl PartialEq for LocalCostMatrix
source§fn eq(&self, other: &LocalCostMatrix) -> bool
fn eq(&self, other: &LocalCostMatrix) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LocalCostMatrix
impl Serialize for LocalCostMatrix
impl Eq for LocalCostMatrix
impl StructuralEq for LocalCostMatrix
impl StructuralPartialEq for LocalCostMatrix
Auto Trait Implementations§
impl RefUnwindSafe for LocalCostMatrix
impl Send for LocalCostMatrix
impl Sync for LocalCostMatrix
impl Unpin for LocalCostMatrix
impl UnwindSafe for LocalCostMatrix
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