ScummVM API documentation
Xeen::InventoryItems Class Referenceabstract
Inheritance diagram for Xeen::InventoryItems:
Common::Array< XeenItem > Xeen::AccessoryItems Xeen::ArmorItems Xeen::MiscItems Xeen::WeaponItems

Public Member Functions

 InventoryItems (Character *character, ItemCategory category)
 
void clear ()
 
InventoryItemsoperator= (const InventoryItems &src)
 
bool passRestrictions (int itemId, bool suppressError=false) const
 
Common::String getName (int itemIndex)
 
virtual Common::String getFullDescription (int itemIndex, int displayNum=15)=0
 
Common::String getIdentifiedDetails (int itemIndex)
 
bool discardItem (int itemIndex)
 
virtual void equipItem (int itemIndex)
 
void removeItem (int itemIndex)
 
void sort ()
 
virtual void enchantItem (int itemIndex, int amount)
 
bool isFull () const
 
- Public Member Functions inherited from Common::Array< XeenItem >
 Array (size_type count)
 
 Array (size_type count, const XeenItem &value)
 
 Array (const Array< XeenItem > &array)
 
 Array (Array< XeenItem > &&old)
 
 Array (std::initializer_list< XeenItem > list)
 
 Array (const T2 *array, size_type n)
 
void push_back (const XeenItem &element)
 
void push_back (const Array< XeenItem > &array)
 
void pop_back ()
 
const XeenItem * data () const
 
XeenItem * data ()
 
XeenItem & front ()
 
const XeenItem & front () const
 
XeenItem & back ()
 
const XeenItem & back () const
 
void insert_at (size_type idx, const XeenItem &element)
 
void insert_at (size_type idx, const Array< XeenItem > &array)
 
void insert (iterator pos, const XeenItem &element)
 
XeenItem remove_at (size_type idx)
 
XeenItem & operator[] (size_type idx)
 
const XeenItem & operator[] (size_type idx) const
 
Array< XeenItem > & operator= (const Array< XeenItem > &array)
 
Arrayoperator= (Array< XeenItem > &&old)
 
size_type size () const
 
void clear ()
 
iterator erase (iterator pos)
 
iterator erase (iterator first, iterator last)
 
bool empty () const
 
bool operator== (const Array< XeenItem > &other) const
 
bool operator!= (const Array< XeenItem > &other) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void reserve (size_type newCapacity)
 
void resize (size_type newSize)
 
void assign (const_iterator first, const_iterator last)
 

Protected Member Functions

XeenEnginegetVm ()
 
void equipError (int itemIndex1, ItemCategory category1, int itemIndex2, ItemCategory category2)
 
virtual Common::String getAttributes (XeenItem &item, const Common::String &classes)=0
 
void capitalizeItem (Common::String &name)
 
const char * getMaeName (int material)
 
- Protected Member Functions inherited from Common::Array< XeenItem >
void allocCapacity (size_type capacity)
 
void freeStorage (XeenItem *storage, const size_type elements)
 
iterator insert_aux (iterator pos, const_iterator first, const_iterator last)
 

Protected Attributes

Character_character
 
ItemCategory _category
 
const char ** _names
 
- Protected Attributes inherited from Common::Array< XeenItem >
size_type _capacity
 
size_type _size
 
XeenItem * _storage
 

Additional Inherited Members

- Public Types inherited from Common::Array< XeenItem >
typedef XeenItem * iterator
 
typedef const XeenItem * const_iterator
 
typedef XeenItem value_type
 
typedef uint size_type
 
- Static Protected Member Functions inherited from Common::Array< XeenItem >
static size_type roundUpCapacity (size_type capacity)
 

Member Function Documentation

◆ getAttributes()

virtual Common::String Xeen::InventoryItems::getAttributes ( XeenItem item,
const Common::String classes 
)
protectedpure virtual

Returns a text string listing all the stats/attributes of a given item

Implemented in Xeen::MiscItems, Xeen::AccessoryItems, Xeen::ArmorItems, and Xeen::WeaponItems.

◆ capitalizeItem()

void Xeen::InventoryItems::capitalizeItem ( Common::String name)
protected

Capitalizes a passed description string that includes embedded formatting for the Items dialog

◆ getMaeName()

const char* Xeen::InventoryItems::getMaeName ( int  material)
protected

Get Material Name

◆ clear()

void Xeen::InventoryItems::clear ( )

Clears the set of items

◆ operator=()

InventoryItems& Xeen::InventoryItems::operator= ( const InventoryItems src)

Handles copying items from one character to another

◆ passRestrictions()

bool Xeen::InventoryItems::passRestrictions ( int  itemId,
bool  suppressError = false 
) const

Return whether a given item passes class-based usage restrictions

Parameters
itemIdItem Index
suppressErrorIf true, no dialog is shown if the item doesn't pass restrictions

◆ getName()

Common::String Xeen::InventoryItems::getName ( int  itemIndex)

Return the bare name of a given inventory item

◆ getIdentifiedDetails()

Common::String Xeen::InventoryItems::getIdentifiedDetails ( int  itemIndex)

Returns the identified details for an item

◆ discardItem()

bool Xeen::InventoryItems::discardItem ( int  itemIndex)

Discard an item from the inventory

◆ equipItem()

virtual void Xeen::InventoryItems::equipItem ( int  itemIndex)
inlinevirtual

Equips an item

Reimplemented in Xeen::AccessoryItems, Xeen::ArmorItems, and Xeen::WeaponItems.

◆ removeItem()

void Xeen::InventoryItems::removeItem ( int  itemIndex)

Un-equips the given item

◆ sort()

void Xeen::InventoryItems::sort ( )

Sorts the items list, removing any empty item slots to the end of the array

◆ enchantItem()

virtual void Xeen::InventoryItems::enchantItem ( int  itemIndex,
int  amount 
)
virtual

Enchants an item

Reimplemented in Xeen::ArmorItems, and Xeen::WeaponItems.

◆ isFull()

bool Xeen::InventoryItems::isFull ( ) const

Return if the given inventory items list is full


The documentation for this class was generated from the following file: