image: Box<dyn PieceSpec>,
qty: Qty,
currency: String,
- #[serde(default="default_min_unit")] min_unit: Qty,
}
-fn default_min_unit() -> Qty { 1 }
-
#[derive(Debug,Serialize,Deserialize)]
pub struct Banknote {
itemname: String,
image: Arc<dyn InertPieceTrait>,
qty: Qty,
currency: String,
- min_unit: Qty,
}
#[typetag::serde(name="Currency")]
-> SpecLoaded {
gpc.rotateable = false;
- let Spec { ref image, ref currency, qty, min_unit } = *self;
+ let Spec { ref image, ref currency, qty } = *self;
let SpecLoadedInert { p: image, occultable:_ } =
image.load_inert(ig, depth)?;
});
}
- if (qty % min_unit) != 0 {
- throw!(SpecError::CurrencyQtyNotMultipleOfUnit)
- }
-
let bnote = Banknote {
image: image.into(),
currency: currency.clone(),
- itemname, qty, min_unit,
+ itemname, qty,
};
let special = PieceSpecialProperties {