Struct ffxiv_crafting::Recipe
source · pub struct Recipe {
pub rlv: i32,
pub job_level: u8,
pub difficulty: u16,
pub quality: u32,
pub durability: u16,
pub conditions_flag: u16,
}
Expand description
储存了一次制作中配方的信息。
Fields§
§rlv: i32
配方等级
job_level: u8
制作配方所需的玩家等级
difficulty: u16
难度(最大进展)
quality: u32
最高品质
durability: u16
耐久
conditions_flag: u16
制作状态标志位,用于表示本次制作有可能出现哪些球色。 该字段从低到高每个bit依次表示对应Condition中的状态是否会出现
Example:
use ffxiv_crafting::Condition;
fn belong(cond_flag: i32, cond: Condition) -> bool {
cond_flag & (1 << cond as usize) != 0
}
let cond_flag = 15; // 15即0b00001111,表示只有可能出现白球、红球、彩球和黑球
assert_eq!(belong(cond_flag, Condition::Normal), true);
assert_eq!(belong(cond_flag, Condition::Good), true);
assert_eq!(belong(cond_flag, Condition::Excellent), true);
assert_eq!(belong(cond_flag, Condition::Poor), true);
assert_eq!(belong(cond_flag, Condition::Centered), false);
assert_eq!(belong(cond_flag, Condition::Sturdy), false);
assert_eq!(belong(cond_flag, Condition::Pliant), false);
assert_eq!(belong(cond_flag, Condition::Malleable), false);
assert_eq!(belong(cond_flag, Condition::Primed), false);
Implementations§
Trait Implementations§
source§impl PartialEq for Recipe
impl PartialEq for Recipe
impl Copy for Recipe
impl Eq for Recipe
impl StructuralPartialEq for Recipe
Auto Trait Implementations§
impl Freeze for Recipe
impl RefUnwindSafe for Recipe
impl Send for Recipe
impl Sync for Recipe
impl Unpin for Recipe
impl UnwindSafe for Recipe
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more