Skip to content

Commit

Permalink
0.3.95 Update (#29)
Browse files Browse the repository at this point in the history
* Step-up version

* Apply extra crate to resolve string/number issues.
  • Loading branch information
bibi-reden authored Feb 3, 2024
1 parent d7f94e0 commit b8ae2b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blue_archive"
version = "0.3.94"
version = "0.3.95"
edition = "2021"
license-file = "LICENSE"
description = "A Blue Archive api wrapper for Rust, based off of SchaleDB's data: https://github.com/lonqie/SchaleDB"
Expand All @@ -25,8 +25,9 @@ rand = "0.8"
anyhow = "1"
thiserror = "1.0"

strum = "0.25"
strum_macros = "0.25"
strum = "0.26"
strum_macros = "0.26"
serde-aux = { version = "4.4.0", default-features = false }

# futures = "0.3"
# chrono = { version = "0.4", features = ["serde"] }
27 changes: 17 additions & 10 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod summons;

pub use raids::RaidData;
use serde::{Deserialize, Serialize};
use serde_aux::prelude::*;
pub use students::{Age, Released, Student};
pub use summons::Summon;

Expand Down Expand Up @@ -137,10 +138,13 @@ pub enum Effect {
ignore_def: Option<Vec<i32>>,
},
DMGDot {
#[serde(alias = "Duration")]
duration: String, // todo: parse.
#[serde(alias = "Period")]
period: String, // todo: parse.
#[serde(
deserialize_with = "deserialize_number_from_string",
alias = "Duration"
)]
duration: u32,
#[serde(deserialize_with = "deserialize_number_from_string", alias = "Period")]
period: u32,
#[serde(alias = "Icon")]
icon: String,
#[serde(alias = "Scale")]
Expand Down Expand Up @@ -175,10 +179,13 @@ pub enum Effect {
scale: ScaleValue,
},
HealDot {
#[serde(alias = "Duration")]
duration: String, // todo: parse.
#[serde(alias = "Period")]
period: String, // todo: parse.
#[serde(
deserialize_with = "deserialize_number_from_string",
alias = "Duration"
)]
duration: u32,
#[serde(deserialize_with = "deserialize_number_from_string", alias = "Period")]
period: u32,
#[serde(alias = "Scale")]
scale: ScaleValue,
},
Expand All @@ -193,8 +200,8 @@ pub enum Effect {
scale: ScaleValue,
},
CrowdControl {
#[serde(alias = "Chance")]
chance: String, // todo: parse.
#[serde(deserialize_with = "deserialize_number_from_string", alias = "Chance")]
chance: u32,
#[serde(alias = "Icon")]
icon: String,
#[serde(alias = "Scale")]
Expand Down

0 comments on commit b8ae2b1

Please sign in to comment.