Adds a large amount of the WASM interface
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -51,6 +51,9 @@ pub trait Form: ValueIdentifiable + Debug {
|
||||
|
||||
/// Check if the form has a specific flag set.
|
||||
fn has_flag(&self, key: &StringKey) -> bool;
|
||||
|
||||
/// Arbitrary flags that can be applied to the move.
|
||||
fn has_flag_by_hash(&self, key_hash: u32) -> bool;
|
||||
}
|
||||
|
||||
/// A form is a variant of a specific species. A species always has at least one form, but can have
|
||||
@@ -207,6 +210,10 @@ impl Form for FormImpl {
|
||||
fn has_flag(&self, key: &StringKey) -> bool {
|
||||
self.flags.contains(key)
|
||||
}
|
||||
|
||||
fn has_flag_by_hash(&self, key_hash: u32) -> bool {
|
||||
self.flags.contains::<u32>(&key_hash)
|
||||
}
|
||||
}
|
||||
|
||||
impl ValueIdentifiable for FormImpl {
|
||||
@@ -240,6 +247,7 @@ pub(crate) mod tests {
|
||||
fn get_random_ability(&self, rand: &mut Random) -> &StringKey;
|
||||
fn get_random_hidden_ability(&self, rand: &mut Random) -> &StringKey;
|
||||
fn has_flag(&self, key: &StringKey) -> bool;
|
||||
fn has_flag_by_hash(&self, key_hash: u32) -> bool;
|
||||
}
|
||||
impl ValueIdentifiable for Form {
|
||||
fn value_identifier(&self) -> ValueIdentifier {
|
||||
|
||||
Reference in New Issue
Block a user