This commit is contained in:
@@ -10,7 +10,7 @@ use crate::dynamic_data::models::pokemon::Pokemon;
|
||||
use crate::dynamic_data::script_handling::{ScriptSource, ScriptSourceData, ScriptWrapper};
|
||||
use crate::dynamic_data::ScriptContainer;
|
||||
use crate::dynamic_data::TargetList;
|
||||
use crate::static_data::MoveData;
|
||||
use crate::static_data::{MoveData, TypeIdentifier};
|
||||
use crate::{PkmnResult, PokemonError};
|
||||
|
||||
/// A hit data is the data for a single hit, on a single target.
|
||||
@@ -25,7 +25,7 @@ pub struct HitData {
|
||||
/// The actual damage of the hit.
|
||||
damage: AtomicU32,
|
||||
/// The type id of the type used for the hit.
|
||||
move_type: AtomicU8,
|
||||
move_type: Atomic<TypeIdentifier>,
|
||||
/// Whether or not the hit has failed.
|
||||
has_failed: AtomicBool,
|
||||
}
|
||||
@@ -48,7 +48,7 @@ impl HitData {
|
||||
self.damage.load(Ordering::Relaxed)
|
||||
}
|
||||
/// The type id of the type used for the hit.
|
||||
pub fn move_type(&self) -> u8 {
|
||||
pub fn move_type(&self) -> TypeIdentifier {
|
||||
self.move_type.load(Ordering::Relaxed)
|
||||
}
|
||||
/// Whether or not the hit has failed.
|
||||
@@ -73,7 +73,7 @@ impl HitData {
|
||||
self.damage.store(value, Ordering::SeqCst);
|
||||
}
|
||||
/// Sets the move type id of the hit.
|
||||
pub fn set_move_type(&self, value: u8) {
|
||||
pub fn set_move_type(&self, value: TypeIdentifier) {
|
||||
self.move_type.store(value, Ordering::SeqCst);
|
||||
}
|
||||
/// Marks the hit as failed.
|
||||
|
||||
Reference in New Issue
Block a user