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§

source§

impl Recipe

source

pub fn new( rlv: i32, difficulty_factor: u16, quality_factor: u16, durability_factor: u16 ) -> Self

Trait Implementations§

source§

impl Clone for Recipe

source§

fn clone(&self) -> Recipe

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Recipe

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Recipe

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Recipe

source§

fn eq(&self, other: &Recipe) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Recipe

source§

impl Eq for Recipe

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.