BagOfHolding class | gadget.t[292]

Mix-in class to help with inventory management. A BagOfHolding can be mixed in with a Container (or, less usually, Surface, RearContainer or Underside) to provide an object which, if held by the player character, will be used to move objects in the player character's inventory to if his/her hands become too full to pick up another object.

`class BagOfHolding : object`

Superclass Tree (in declaration order)

`BagOfHolding`
`object`

Subclass Tree

(none)

Global Objects

(none)

Summary of Properties

`canDropContents`

Summary of Methods

`affinityFor moveAction suitabilityFor tryHolding`

Properties

`canDropContents` | `gadget.t[459]`

A BagOfHolding carried by the actor allows its contents to be dropped (via an implicit TAkeFrom) without the actor havign to perfoam an explicit take.

Methods

`affinityFor (obj)` | `gadget.t[302]`

The affinity for this BagOfHolding for obj. This can be used to determined how 'willing' a particular BagOfHolding is to contain obj. A value of less than 1 means that the BagOfHolding can't contain obj at all. The higher the affinity, the better the choice this BagOfHolding is for obj. The default value is 100, or 0 for a BagOfHolding's affinity for itself.

`moveAction ( )` | `gadget.t[429]`

The action needed to move an object into me.

`suitabilityFor (obj)` | `gadget.t[312]`

To be suitable to contain obj a BagOfHolding must have enough spare capacity for it. If it has, its suitability is its affinity for obj; otherwise it's 0. A BagOfHolding is also unsuitable if it's locked.

`tryHolding (obj)` | `gadget.t[327]`

Class method to determine whether the actor is carrying a suitable BagOfHolding that could be used to move something from his inventory into, and then to move items from the actor's inventory into an appropriate bag of holding.

Adv3Lite Library Reference Manual
Generated on 25/04/2024 from adv3Lite version 2.0