Struct rpg::item_generator::ItemGenerator
[−]
[src]
pub struct ItemGenerator { /* fields omitted */ }
A builder like generator for items. Missing fields are filled randomly
Methods
impl ItemGenerator
[src]
fn new() -> ItemGenerator
Creates a new instance of ItemGenerator
fn name(self, name: &str) -> ItemGenerator
Sets the name
of the item
fn item_type(self, item_type: ItemType) -> ItemGenerator
Sets the item_type
of the item
fn influence(self, influence: Option<ItemInfluence>) -> ItemGenerator
Sets the influence
of the item
fn stack_size(self, stack_size: usize) -> ItemGenerator
Sets the stack_size
of the item
fn rarity(self, rarity: ItemRarity) -> ItemGenerator
Sets the rarity
of the item
fn gen(&self) -> Item
Generates the item using the given data. Missing data will be filed randomly
Trait Implementations
impl Clone for ItemGenerator
[src]
fn clone(&self) -> ItemGenerator
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for ItemGenerator
[src]
fn eq(&self, __arg_0: &ItemGenerator) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ItemGenerator) -> bool
This method tests for !=
.