Initial work on FFI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-09-18 18:02:13 +02:00
parent 39497891e9
commit 726e294f11
19 changed files with 814 additions and 26 deletions

View File

@@ -9,6 +9,7 @@ use crate::StringKey;
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[repr(u8)]
pub enum MoveCategory {
/// A physical move uses the physical attack stats and physical defense stats to calculate damage.
Physical = 0,
@@ -21,6 +22,7 @@ pub enum MoveCategory {
/// The move target defines what kind of targets the move can touch.
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(u8)]
pub enum MoveTarget {
/// Adjacent allows a move to target any Pokemon that is either directly to the left or right of
/// the user, opposed to the user, or left or right of the slot that is opposing the user.

View File

@@ -1,20 +1,6 @@
use crate::static_data::EffectParameter;
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),
/// An integer value. Stored as a 64 bit int to deal with potentially large numbers.
Int(i64),
/// A float value. Stored as a 32 bit float.
Float(f32),
/// A string value.
String(StringKey),
}
/// A secondary effect is an effect on a move that happens after it hits.
#[derive(PartialEq, Debug)]
pub struct SecondaryEffect {