Difference between revisions of "CInventory"
Shadlington (Talk | contribs) |
Shadlington (Talk | contribs) |
||
Line 1: | Line 1: | ||
<onlyinclude> | <onlyinclude> | ||
− | Represents an inventory - a container for | + | Represents an inventory - a container for [[CBlob]]s that is itself part of (owned by) a [[CBlob]]. |
</onlyinclude> | </onlyinclude> | ||
+ | |||
+ | For example, it may be the inventory of a catapult contains the stone and other [[CBlob]]s that have been loaded into it. | ||
Methods: | Methods: |
Revision as of 19:21, 19 August 2012
Represents an inventory - a container for CBlobs that is itself part of (owned by) a CBlob.
For example, it may be the inventory of a catapult contains the stone and other CBlobs that have been loaded into it.
Methods:
Method | Description |
---|---|
getBlob |
Returns a reference to the CBlob that owns this object. It is a method common to several object types that are considered 'components'. |
getItemsCount |
Returns the number of CBlob stacks in this inventory as an int. |
getItem |
Returns a reference to the CBlob at the given index in this inventory's item list. |
canPutItem |
Returns a a bool indicating whether or not it is possible to put the given CBlob in this inventory. |
putInItem |
Puts the given CBlob in this inventory. Returns true if this was successful, otherwise it returns false. |
putOutItem |
Removes the given a CBlob from this inventory, either by CBlob reference or by name. |
RemoveItems |
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. |
isInInventory |
Checks if the given CBlob exists in this inventory, either by CBlob reference or by name. |
hasRequirements |
Checks if this inventory contains the given requirements, and writes any missing requirements into a given CBitStream. Returns true if the requirements are met, otherwise false. |
TakeRequirements |
Removes the requirements specified in the given CBitStream from this inventory. |
MoveInventoryTo |
Removes all of the CBlobs in this inventory and puts them in the given other inventory. Returns true if all CBlobs were moved successfully, otherwise false. |