[−][src]Struct game_features::ItemDefinitionBuilder
Builder for ItemDefinition
.
Methods
impl<K: Clone, T: Clone, D: Default + Clone> ItemDefinitionBuilder<K, T, D>
[src]
pub fn key(&mut self, value: K) -> &mut Self
[src]
The key identifying this item definition.
pub fn item_type(&mut self, value: T) -> &mut Self
[src]
The type / item group that this item definition is part of.
pub fn name(&mut self, value: String) -> &mut Self
[src]
The display name of this item definition.
pub fn friendly_name(&mut self, value: String) -> &mut Self
[src]
The friendly name of this item definition. Mostly used to find items by name instead of by key.
pub fn description(&mut self, value: String) -> &mut Self
[src]
The display description of this item definition.
pub fn maximum_stack(&mut self, value: usize) -> &mut Self
[src]
The maximum number of elements that can be in an item stack. Setting this value to 1 disables the ability to stack this type of item.
pub fn maximum_durability(&mut self, value: Option<usize>) -> &mut Self
[src]
The default maximum durability of this item. Setting this to None means that this item type doesn't use the concept of durability and is unbreakable.
pub fn user_data(&mut self, value: D) -> &mut Self
[src]
Custom user data. For example: rarity, weight, list of allowed upgrades, etc...
pub fn build(&self) -> Result<ItemDefinition<K, T, D>, String>
[src]
Trait Implementations
impl<K: Default, T: Default, D: Default + Default> Default for ItemDefinitionBuilder<K, T, D>
[src]
fn default() -> ItemDefinitionBuilder<K, T, D>
[src]
impl<K: Clone, T: Clone, D: Clone + Default> Clone for ItemDefinitionBuilder<K, T, D>
[src]
fn clone(&self) -> ItemDefinitionBuilder<K, T, D>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<K, T, D> Send for ItemDefinitionBuilder<K, T, D> where
D: Send,
K: Send,
T: Send,
D: Send,
K: Send,
T: Send,
impl<K, T, D> Sync for ItemDefinitionBuilder<K, T, D> where
D: Sync,
K: Sync,
T: Sync,
D: Sync,
K: Sync,
T: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,