Struct rpg::character::Character
[−]
[src]
pub struct Character { /* fields omitted */ }
The character the player is impersonating
Methods
impl Character
[src]
fn new(name: &str) -> Character
Creates a new instance of Character
fn update_attribute(&mut self, attribute: &Attribute, value: AttributeValue)
Updates the given attribute
fn attack_damage(&self) -> AttributeValue
Calculates and returns the current attack damage of the character based on the attibutes
fn get_attribute_value(&self, attribute: &Attribute) -> AttributeValue
Returns the value of the specified attribute
fn set_armor_slot_head(&mut self, item: Option<Item>)
A setter method for the head armor slot. Panics whether the given item is not
of type ItemType::ArmorHead
fn set_armor_slot_chest(&mut self, item: Option<Item>)
A setter method for the chest armor slot. Panics whether the given item is not
of type ItemType::ArmorChest
fn set_armor_slot_legs(&mut self, item: Option<Item>)
A setter method for the legs armor slot. Panics whether the given item is not
of type ItemType::ArmorLegs
fn set_armor_slot_feet(&mut self, item: Option<Item>)
A setter method for the feet armor slot. Panics whether the given item is not
of type ItemType::ArmorFeet
fn set_weapon_slot_right(&mut self, item: Option<Item>)
A setter method for the right weapon slot
fn set_weapon_slot_left(&mut self, item: Option<Item>)
A setter method for the left weapon slot
fn default_attributes() -> HashMap<Attribute, AttributeValue>
Returns the default attributes for a character