A lot more work on WASM script execution
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-09-07 18:01:26 +02:00
parent f9761f61da
commit b1890681a1
102 changed files with 748 additions and 202 deletions

3
src/dynamic_data/models/executing_move.rs Normal file → Executable file
View File

@@ -15,6 +15,7 @@ use crate::{PkmnResult, PokemonError};
/// A hit data is the data for a single hit, on a single target.
#[derive(Default, Debug)]
#[cfg_attr(feature = "wasm", derive(unique_type_id_derive::UniqueTypeId))]
pub struct HitData {
/// Whether or not the hit is critical.
critical: AtomicBool,
@@ -158,7 +159,7 @@ impl ExecutingMove {
}
/// Gets a hit data for a target, with a specific index.
pub fn get_hit_data<'func>(&'func self, for_target: &'func Arc<Pokemon>, hit: u8) -> PkmnResult<&'func HitData> {
pub fn get_hit_data(&self, for_target: &Pokemon, hit: u8) -> PkmnResult<&HitData> {
for (index, target) in self.targets.iter().enumerate() {
if let Some(target) = target {
if std::ptr::eq(target.deref().deref(), for_target.deref().deref()) {