[−][src]Struct sulis_state::inventory::Inventory
Fields
equipped: HashMap<Slot, ItemState>
quick: HashMap<QuickSlot, ItemState>
Implementations
impl Inventory
[src]
pub fn empty() -> Inventory
[src]
pub fn load(
&mut self,
equipped: Vec<Option<ItemSaveState>>,
quick: Vec<Option<ItemSaveState>>
) -> Result<(), Error>
[src]
&mut self,
equipped: Vec<Option<ItemSaveState>>,
quick: Vec<Option<ItemSaveState>>
) -> Result<(), Error>
pub fn alt_weapon_style(&self) -> WeaponStyle
[src]
pub fn weapon_style(&self) -> WeaponStyle
[src]
pub fn quick(&self, slot: QuickSlot) -> Option<&ItemState>
[src]
pub fn equipped(&self, slot: Slot) -> Option<&ItemState>
[src]
pub fn equipped_iter(&self) -> EquippedIterator<'_>ⓘNotable traits for EquippedIterator<'a>
impl<'a> Iterator for EquippedIterator<'a> type Item = &'a ItemState;
[src]
Notable traits for EquippedIterator<'a>
impl<'a> Iterator for EquippedIterator<'a> type Item = &'a ItemState;
Returns an iterator traversing all equipped items in this inventory. This will only include slots that actually have an item equipped
pub fn swap_weapon_set(&mut self)
[src]
#[must_use]pub fn clear_quick(&mut self, quick_slot: QuickSlot) -> Option<ItemState>
[src]
pub fn can_set_quick(
&mut self,
item_state: &ItemState,
slot: QuickSlot,
actor: &Rc<Actor>
) -> bool
[src]
&mut self,
item_state: &ItemState,
slot: QuickSlot,
actor: &Rc<Actor>
) -> bool
Returns true if the given item can be set to the given quick slot, false otherwise
#[must_use]pub fn set_quick(
&mut self,
item_state: ItemState,
slot: QuickSlot
) -> Option<ItemState>
[src]
&mut self,
item_state: ItemState,
slot: QuickSlot
) -> Option<ItemState>
Sets the given item to the quick slot. The caller must validate that the
item can be set with can_set_quick
prior to doing this
#[must_use]pub fn equip(
&mut self,
item_state: ItemState,
preferred_slot: Option<Slot>
) -> Vec<ItemState>
[src]
&mut self,
item_state: ItemState,
preferred_slot: Option<Slot>
) -> Vec<ItemState>
Equips the specified item. you must verify that the item can be equipped
with can_equip
first. Returns a vec of any items that were unequipped as
a result of equipping this item
#[must_use]pub fn clear_quickslot(&mut self, quick_slot: QuickSlot) -> Option<ItemState>
[src]
#[must_use]pub fn unequip(&mut self, slot: Slot) -> Option<ItemState>
[src]
pub fn get_image_layers(&self) -> HashMap<ImageLayer, Rc<dyn Image>>
[src]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Inventory
impl !Send for Inventory
impl !Sync for Inventory
impl Unpin for Inventory
impl !UnwindSafe for Inventory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,