pub struct LocalRoomTerrain { /* private fields */ }
Implementations§
Source§impl LocalRoomTerrain
A matrix representing the terrain of a room, stored in Rust memory.
impl LocalRoomTerrain
A matrix representing the terrain of a room, stored in Rust memory.
Use RoomTerrain
if data stored in JavaScript memory is preferred.
Sourcepub fn get_xy(&self, xy: RoomXY) -> Terrain
pub fn get_xy(&self, xy: RoomXY) -> Terrain
Gets the terrain at the specified position in this room.
Sourcepub fn new_from_bits(bits: Box<[u8; 2500]>) -> Self
pub fn new_from_bits(bits: Box<[u8; 2500]>) -> Self
Creates a LocalRoomTerrain
from the bytes that correspond to the
room’s terrain data.
This is like the RoomTerrain
type but performs all operations on data
stored in wasm memory. Each byte in the array corresponds to the value
of the Terrain
at the given position.
The bytes are in row-major order - that is they start at the top left,
then move to the top right, and then start at the left of the next row.
This is different from LocalCostMatrix
, which is column-major.
Sourcepub fn get_bits(&self) -> &[u8; 2500]
pub fn get_bits(&self) -> &[u8; 2500]
Gets a slice of the underlying bytes that comprise the room’s terrain data.
The bytes are in row-major order - that is they start at the top left,
then move to the top right, and then start at the left of the next row.
This is different from LocalCostMatrix
, which is column-major.
Trait Implementations§
Source§impl Clone for LocalRoomTerrain
impl Clone for LocalRoomTerrain
Source§fn clone(&self) -> LocalRoomTerrain
fn clone(&self) -> LocalRoomTerrain
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more