pub struct WasmMap { /* private fields */ }
Implementations§
Source§impl WasmMap
impl WasmMap
pub fn new( name: String, layers: Vec<WasmLayer>, spawn: &WasmCoordinates, ) -> WasmMap
pub fn name(&self) -> String
pub fn spawn(&self) -> WasmCoordinates
pub fn layers(&self) -> Vec<WasmLayer>
Sourcepub fn load_layer(&mut self, layer: WasmLayer)
pub fn load_layer(&mut self, layer: WasmLayer)
Load a new layer into the map.
Sourcepub fn layers_by_name(&self) -> Object
pub fn layers_by_name(&self) -> Object
Returns a JS object mapping layer names to WasmLayer instances.
Sourcepub fn merge_at(
&mut self,
other: WasmMap,
top_left: WasmCoordinates,
spawn: Option<WasmCoordinates>,
)
pub fn merge_at( &mut self, other: WasmMap, top_left: WasmCoordinates, spawn: Option<WasmCoordinates>, )
Merge another map at a given offset; optionally update spawn.
Sourcepub fn duplicate_to_the(
&mut self,
direction: WasmDirection,
spawn: Option<WasmCoordinates>,
)
pub fn duplicate_to_the( &mut self, direction: WasmDirection, spawn: Option<WasmCoordinates>, )
Duplicate this map in a direction; optionally update spawn.
Sourcepub fn get_actions_at(&self, pointer: &WasmCoordinates) -> Vec<u32>
pub fn get_actions_at(&self, pointer: &WasmCoordinates) -> Vec<u32>
Returns all action IDs at a coordinate from all layers.
Trait Implementations§
Source§impl FromWasmAbi for WasmMap
impl FromWasmAbi for WasmMap
Source§impl IntoWasmAbi for WasmMap
impl IntoWasmAbi for WasmMap
Source§impl LongRefFromWasmAbi for WasmMap
impl LongRefFromWasmAbi for WasmMap
Source§impl OptionFromWasmAbi for WasmMap
impl OptionFromWasmAbi for WasmMap
Source§impl OptionIntoWasmAbi for WasmMap
impl OptionIntoWasmAbi for WasmMap
Source§impl RefFromWasmAbi for WasmMap
impl RefFromWasmAbi for WasmMap
Source§impl RefMutFromWasmAbi for WasmMap
impl RefMutFromWasmAbi for WasmMap
Source§impl TryFromJsValue for WasmMap
impl TryFromJsValue for WasmMap
Source§impl VectorFromWasmAbi for WasmMap
impl VectorFromWasmAbi for WasmMap
Source§impl VectorIntoWasmAbi for WasmMap
impl VectorIntoWasmAbi for WasmMap
Source§impl WasmWrapper<Map> for WasmMap
impl WasmWrapper<Map> for WasmMap
impl SupportsConstructor for WasmMap
impl SupportsInstanceProperty for WasmMap
impl SupportsStaticProperty for WasmMap
Auto Trait Implementations§
impl Freeze for WasmMap
impl RefUnwindSafe for WasmMap
impl Send for WasmMap
impl Sync for WasmMap
impl Unpin for WasmMap
impl UnwindSafe for WasmMap
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.