Difference between revisions of "CInventory"
Shadlington (Talk | contribs) |
Shadlington (Talk | contribs) |
||
(7 intermediate revisions by the same user not shown) | |||
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 containing the stone or other [[CBlob]]s that have been loaded into it. | ||
Methods: | Methods: | ||
Line 10: | Line 12: | ||
! '''Description''' | ! '''Description''' | ||
|- | |- | ||
− | | [[ | + | | [[Component::getBlob|getBlob]] |
− | | {{: | + | | {{:Component::getBlob|getBlob}} |
+ | |- | ||
+ | | [[CInventory::getItemsCount|getItemsCount]] | ||
+ | | {{:CInventory::getItemsCount|getItemsCount}} | ||
+ | |- | ||
+ | | [[CInventory::getItem|getItem]] | ||
+ | | {{:CInventory::getItem|getItem}} | ||
+ | |- | ||
+ | | [[CInventory::canPutItem|canPutItem]] | ||
+ | | {{:CInventory::canPutItem|canPutItem}} | ||
+ | |- | ||
+ | | [[CInventory::putInItem|putInItem]] | ||
+ | | {{:CInventory::putInItem|putInItem}} | ||
+ | |- | ||
+ | | [[CInventory::putOutItem|putOutItem]] | ||
+ | | {{:CInventory::putOutItem|putOutItem}} | ||
+ | |- | ||
+ | | [[CInventory::RemoveItems|RemoveItems]] | ||
+ | | {{:CInventory::RemoveItems|RemoveItems}} | ||
+ | |- | ||
+ | | [[CInventory::RemoveAll|RemoveAll]] | ||
+ | | {{:CInventory::RemoveAll|RemoveAll}} | ||
+ | |- | ||
+ | | [[CInventory::isInInventory|isInInventory]] | ||
+ | | {{:CInventory::isInInventory|isInInventory}} | ||
+ | |- | ||
+ | | [[CInventory::hasRequirements|hasRequirements]] | ||
+ | | {{:CInventory::hasRequirements|hasRequirements}} | ||
+ | |- | ||
+ | | [[CInventory::TakeRequirements|TakeRequirements]] | ||
+ | | {{:CInventory::TakeRequirements|TakeRequirements}} | ||
+ | |- | ||
+ | | [[CInventory::MoveInventoryTo|MoveInventoryTo]] | ||
+ | | {{:CInventory::MoveInventoryTo|MoveInventoryTo}} | ||
|- | |- | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Scripting]] | [[Category:Scripting]] | ||
[[Category:Object Types]] | [[Category:Object Types]] |
Latest revision as of 17:38, 22 September 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 containing the stone or 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. |
RemoveAll |
Removes all items from this inventory. |
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. |