Public Member Functions | |
void | freeGraphics () |
Inventory (SherlockEngine *vm) | |
void | freeInv () |
void | loadGraphics () |
int | findInv (const Common::String &name) |
int | putNameInInventory (const Common::String &name) |
int | putItemInInventory (Object &obj) |
int | deleteItemFromInventory (const Common::String &name) |
void | synchronize (Serializer &s) |
virtual void | loadInv ()=0 |
Public Member Functions inherited from Common::Array< InventoryItem > | |
Array (size_type count) | |
Array (size_type count, const InventoryItem &value) | |
Array (const Array< InventoryItem > &array) | |
Array (Array< InventoryItem > &&old) | |
Array (std::initializer_list< InventoryItem > list) | |
Array (const T2 *array, size_type n) | |
void | emplace (const_iterator pos, TArgs &&... args) |
void | emplace_back (TArgs &&...args) |
void | push_back (const InventoryItem &element) |
void | push_back (InventoryItem &&element) |
void | push_back (const Array< InventoryItem > &array) |
void | pop_back () |
const InventoryItem * | data () const |
InventoryItem * | data () |
InventoryItem & | front () |
const InventoryItem & | front () const |
InventoryItem & | back () |
const InventoryItem & | back () const |
void | insert_at (size_type idx, const InventoryItem &element) |
void | insert_at (size_type idx, const Array< InventoryItem > &array) |
void | insert (iterator pos, const InventoryItem &element) |
InventoryItem | remove_at (size_type idx) |
InventoryItem & | operator[] (size_type idx) |
const InventoryItem & | operator[] (size_type idx) const |
Array< InventoryItem > & | operator= (const Array< InventoryItem > &array) |
Array & | operator= (Array< InventoryItem > &&old) |
size_type | size () const |
void | clear () |
iterator | erase (iterator pos) |
iterator | erase (iterator first, iterator last) |
bool | empty () const |
bool | operator== (const Array< InventoryItem > &other) const |
bool | operator!= (const Array< InventoryItem > &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 | resize (size_type newSize, const InventoryItem value) |
void | assign (const_iterator first, const_iterator last) |
void | swap (Array &arr) |
Static Public Member Functions | |
static Inventory * | init (SherlockEngine *vm) |
Public Attributes | |
Common::Array< ImageFile * > | _invShapes |
bool | _invGraphicsLoaded |
InvMode | _invMode |
int | _invIndex |
int | _holdings |
Protected Member Functions | |
void | copyToInventory (Object &obj) |
Protected Member Functions inherited from Common::Array< InventoryItem > | |
void | allocCapacity (size_type capacity) |
void | freeStorage (InventoryItem *storage, const size_type elements) |
iterator | insert_aux (iterator pos, const_iterator first, const_iterator last) |
Protected Attributes | |
SherlockEngine * | _vm |
Common::StringArray | _names |
Protected Attributes inherited from Common::Array< InventoryItem > | |
size_type | _capacity |
size_type | _size |
InventoryItem * | _storage |
Additional Inherited Members | |
Public Types inherited from Common::Array< InventoryItem > | |
typedef InventoryItem * | iterator |
typedef const InventoryItem * | const_iterator |
typedef InventoryItem | value_type |
typedef uint | size_type |
Static Protected Member Functions inherited from Common::Array< InventoryItem > | |
static size_type | roundUpCapacity (size_type capacity) |
|
protected |
Copy the passed object into the inventory
void Sherlock::Inventory::freeGraphics | ( | ) |
Free any loaded inventory graphics
void Sherlock::Inventory::freeInv | ( | ) |
Free inventory data
void Sherlock::Inventory::loadGraphics | ( | ) |
Load the list of names of graphics for the inventory
int Sherlock::Inventory::findInv | ( | const Common::String & | name | ) |
Searches through the list of names that correspond to the inventory items and returns the number that matches the passed name
int Sherlock::Inventory::putNameInInventory | ( | const Common::String & | name | ) |
Adds a shape from the scene to the player's inventory
int Sherlock::Inventory::putItemInInventory | ( | Object & | obj | ) |
Moves a specified item into the player's inventory If the item has a PICKUP use action, then the item in the use action are added to the inventory.
int Sherlock::Inventory::deleteItemFromInventory | ( | const Common::String & | name | ) |
Deletes a specified item from the player's inventory
void Sherlock::Inventory::synchronize | ( | Serializer & | s | ) |
Synchronize the data for a savegame
|
pure virtual |
Load the list of names the inventory items correspond to, if not already loaded, and then calls loadGraphics to load the associated graphics
Implemented in Sherlock::Scalpel::ScalpelInventory, and Sherlock::Tattoo::TattooInventory.