Struct screeps::local::SparseCostMatrix
source · pub struct SparseCostMatrix { /* private fields */ }
Implementations§
source§impl SparseCostMatrix
impl SparseCostMatrix
pub fn new() -> Self
pub fn get(&self, xy: RoomXY) -> u8
pub fn set(&mut self, xy: RoomXY, val: u8)
pub fn iter(&self) -> impl Iterator<Item = (RoomXY, u8)> + '_
pub fn iter_mut(&mut self) -> impl Iterator<Item = (RoomXY, &mut u8)>
pub fn merge_from_dense(&mut self, src: &LocalCostMatrix)
pub fn merge_from_sparse(&mut self, src: &SparseCostMatrix)
Trait Implementations§
source§impl Clone for SparseCostMatrix
impl Clone for SparseCostMatrix
source§fn clone(&self) -> SparseCostMatrix
fn clone(&self) -> SparseCostMatrix
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 Debug for SparseCostMatrix
impl Debug for SparseCostMatrix
source§impl Default for SparseCostMatrix
impl Default for SparseCostMatrix
source§impl<'de> Deserialize<'de> for SparseCostMatrix
impl<'de> Deserialize<'de> for SparseCostMatrix
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 SparseCostMatrix
impl From<&CostMatrix> for SparseCostMatrix
source§fn from(js_matrix: &CostMatrix) -> Self
fn from(js_matrix: &CostMatrix) -> Self
Converts to this type from the input type.
source§impl From<&HashMap<Position, u8, RandomState>> for SparseCostMatrix
impl From<&HashMap<Position, u8, RandomState>> for SparseCostMatrix
source§impl From<&HashMap<RoomXY, u8, RandomState>> for SparseCostMatrix
impl From<&HashMap<RoomXY, u8, RandomState>> for SparseCostMatrix
source§impl From<&LocalCostMatrix> for SparseCostMatrix
impl From<&LocalCostMatrix> for SparseCostMatrix
source§fn from(lcm: &LocalCostMatrix) -> Self
fn from(lcm: &LocalCostMatrix) -> Self
Converts to this type from the input type.
source§impl From<&SparseCostMatrix> for LocalCostMatrix
impl From<&SparseCostMatrix> for LocalCostMatrix
source§fn from(scm: &SparseCostMatrix) -> Self
fn from(scm: &SparseCostMatrix) -> Self
Converts to this type from the input type.
source§impl From<HashMap<RoomXY, u8, RandomState>> for SparseCostMatrix
impl From<HashMap<RoomXY, u8, RandomState>> for SparseCostMatrix
source§impl From<SparseCostMatrix> for LocalCostMatrix
impl From<SparseCostMatrix> for LocalCostMatrix
source§fn from(scm: SparseCostMatrix) -> Self
fn from(scm: SparseCostMatrix) -> Self
Converts to this type from the input type.
source§impl PartialEq<SparseCostMatrix> for SparseCostMatrix
impl PartialEq<SparseCostMatrix> for SparseCostMatrix
source§fn eq(&self, other: &SparseCostMatrix) -> bool
fn eq(&self, other: &SparseCostMatrix) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.