Initial work on wasm scripting backend
This commit is contained in:
@@ -26,6 +26,11 @@ pub trait DataLibrary<'a, T: 'a> {
|
||||
self.map().get::<StringKey>(key)
|
||||
}
|
||||
|
||||
/// Gets a value from the library.
|
||||
fn get_by_hash(&'a self, key: u32) -> Option<&'a T> {
|
||||
self.map().get::<u32>(&key)
|
||||
}
|
||||
|
||||
/// Gets a mutable value from the library.
|
||||
fn get_mut(&mut self, key: &StringKey) -> Option<&mut T> {
|
||||
self.get_modify().get_mut(key)
|
||||
|
||||
@@ -6,6 +6,7 @@ use crate::StringKey;
|
||||
|
||||
/// A library to store all data for moves.
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(feature = "wasm", derive(unique_type_id_derive::UniqueTypeId))]
|
||||
pub struct MoveLibrary {
|
||||
/// The underlying map.
|
||||
map: IndexMap<StringKey, MoveData>,
|
||||
|
||||
@@ -9,6 +9,7 @@ use crate::static_data::TypeLibrary;
|
||||
|
||||
/// The storage for all different libraries.
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(feature = "wasm", derive(unique_type_id_derive::UniqueTypeId))]
|
||||
pub struct StaticData {
|
||||
/// Several misc settings for the library.
|
||||
settings: LibrarySettings,
|
||||
|
||||
Reference in New Issue
Block a user