Difference between revisions of "CInventory::RemoveItems"

From King Arthur's Gold Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
Removes all items from this inventory.
+
Removes the a given quantity of [[CBlob]]s from this inventory by name. Returns true if there were as many matching items removed as requested, otherwise false.
 
</onlyinclude>
 
</onlyinclude>
  
 +
The first argument is the name to match [[CBlob]]s by, the second argument is the quantity of them to remove.
 +
If the quantity is 0 it will entirely remove the first stack of matching [[CBlob]]s it finds.
 +
 +
The method will only return full if there were at least as many matching [[CBlob]]s as the quantity argument (or at least one stack if quantity was 0).
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
void RemoveAll()
+
bool RemoveItems(const string &blobName, int quantity)
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Latest revision as of 17:44, 22 September 2012

Removes the a given quantity of CBlobs from this inventory by name. Returns true if there were as many matching items removed as requested, otherwise false.


The first argument is the name to match CBlobs by, the second argument is the quantity of them to remove. If the quantity is 0 it will entirely remove the first stack of matching CBlobs it finds.

The method will only return full if there were at least as many matching CBlobs as the quantity argument (or at least one stack if quantity was 0).

bool RemoveItems(const string &blobName, int quantity)

Object method of: CInventory