pub struct Item {Show 17 fields
pub id: u64,
pub name: String,
pub description: String,
pub category: ItemCategory,
pub rarity: Rarity,
pub level: u32,
pub base_stats: Vec<StatModifier>,
pub affixes: Vec<ItemAffix>,
pub effects: Vec<ItemEffect>,
pub stack_size: u32,
pub max_stack: u32,
pub value: u64,
pub weight: f32,
pub glyph: char,
pub sockets: Vec<Option<Item>>,
pub element: Option<Element>,
pub set_id: Option<u32>,
}Fields§
§id: u64§name: String§description: String§category: ItemCategory§rarity: Rarity§level: u32§base_stats: Vec<StatModifier>§affixes: Vec<ItemAffix>§effects: Vec<ItemEffect>§stack_size: u32§max_stack: u32§value: u64§weight: f32§glyph: char§sockets: Vec<Option<Item>>§element: Option<Element>§set_id: Option<u32>Implementations§
Source§impl Item
impl Item
pub fn new( name: impl Into<String>, category: ItemCategory, rarity: Rarity, level: u32, ) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_stat(self, stat: StatId, kind: ModifierType) -> Self
pub fn with_affix(self, affix: ItemAffix) -> Self
pub fn with_effect(self, effect: ItemEffect) -> Self
pub fn with_element(self, el: Element) -> Self
pub fn add_socket(self) -> Self
pub fn socket_gem(&mut self, slot: usize, gem: Item) -> bool
pub fn display_name(&self) -> String
pub fn all_modifiers(&self) -> Vec<&StatModifier>
pub fn tooltip(&self) -> String
Sourcepub fn stat_bonus(&self, stat: StatId, base: f32) -> f32
pub fn stat_bonus(&self, stat: StatId, base: f32) -> f32
Compute net combat stat bonus for a specific stat.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnsafeUnpin for Item
impl UnwindSafe for Item
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