More work on WASM handling.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-08-20 12:22:12 +02:00
parent 703fd2c147
commit 2d4253e155
36 changed files with 922 additions and 87 deletions

View File

@@ -153,6 +153,11 @@ impl MoveData {
/// Arbitrary flags that can be applied to the move.
pub fn has_flag(&self, key: &StringKey) -> bool {
self.flags.contains(key)
self.flags.contains::<StringKey>(key)
}
/// Arbitrary flags that can be applied to the move.
pub fn has_flag_by_hash(&self, key_hash: u32) -> bool {
self.flags.contains::<u32>(&key_hash)
}
}

View File

@@ -3,6 +3,7 @@ use crate::StringKey;
/// A parameter for an effect. This is basically a simple way to dynamically store multiple different
/// primitives on data.
#[derive(PartialEq, Debug)]
#[cfg_attr(feature = "wasm", derive(unique_type_id_derive::UniqueTypeId))]
pub enum EffectParameter {
/// A boolean value.
Bool(bool),
@@ -11,7 +12,7 @@ pub enum EffectParameter {
/// A float value. Stored as a 32 bit float.
Float(f32),
/// A string value.
String(String),
String(StringKey),
}
/// A secondary effect is an effect on a move that happens after it hits.