ScummVM API documentation
MM::MM1::Inventory Class Reference

Classes

struct  Entry
 

Public Member Functions

Entryoperator[] (uint idx)
 
const Entryoperator[] (uint idx) const
 
void synchronize (Common::Serializer &s, bool ids)
 
void clear ()
 
bool empty () const
 
bool full () const
 
uint size () const
 
uint add (byte id, byte charges)
 
void removeAt (uint idx)
 
void remove (Entry *e)
 
int indexOf (Entry *e) const
 
int indexOf (byte itemId) const
 
void removeCharge (Entry *e)
 
bool hasWeapon () const
 
bool hasMissile () const
 
bool hasTwoHanded () const
 
bool hasArmor () const
 
bool hasShield () const
 
size_t getPerformanceTotal () const
 

Member Function Documentation

◆ synchronize()

void MM::MM1::Inventory::synchronize ( Common::Serializer s,
bool  ids 
)

Saves or loads the inventory data

◆ clear()

void MM::MM1::Inventory::clear ( )

Clears the inventory

◆ empty()

bool MM::MM1::Inventory::empty ( ) const

Returns true if the inventory is empty

◆ full()

bool MM::MM1::Inventory::full ( ) const

Returns true if the inventory is full

◆ size()

uint MM::MM1::Inventory::size ( ) const

Returns the size of the backpack that's filled in

◆ add()

uint MM::MM1::Inventory::add ( byte  id,
byte  charges 
)

Adds an item to the inventory

◆ removeAt()

void MM::MM1::Inventory::removeAt ( uint  idx)

Removes an index from the inventory

◆ remove()

void MM::MM1::Inventory::remove ( Entry e)

Remove an entry from the inventory

◆ indexOf() [1/2]

int MM::MM1::Inventory::indexOf ( Entry e) const

Returns the index of a given entry

◆ indexOf() [2/2]

int MM::MM1::Inventory::indexOf ( byte  itemId) const

Returns the index of an entry with a given id

◆ removeCharge()

void MM::MM1::Inventory::removeCharge ( Entry e)

Decreases the charge on a magic item, and removes it if the charges have run out

◆ hasWeapon()

bool MM::MM1::Inventory::hasWeapon ( ) const
inline

The following methods return true if any of the contained items are of the given category


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