## Public API Reference

- Main Page
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iCelInventorySpace Struct Reference

This interface represents a space system for the inventory property class. More...

`#include <propclass/inv.h>`

List of all members.

## Public Member Functions

virtual bool | AddEntity (iCelEntity *entity, iCelParameterBlock *params)=0
| Add an entity on a given slot.
virtual bool | AddEntity (iCelEntity *entity)=0
| When some code calls old-style AddEntity() (with no parameters) on the iPcInventory then this function will be called.
virtual iCelEntity * | GetEntity (iCelParameterBlock *params)=0
| Try to get a certain entity from a slot.
virtual iCelInventorySpaceSlot * | GetSlot (iCelParameterBlock *params)=0
| Try to get a certain slot.
virtual int | GetSpaceLeft () const =0
| Return how much space is left.
virtual int | GetSpaceTotal () const =0
| Return how much space is available in total.
virtual bool | RemoveEntity (iCelParameterBlock *params)=0
| Remove an entity (or entities) from the specified slot (through 'params').
virtual bool | RemoveEntity (iCelEntity *entity)=0
| Remove the entity from its slot.

## Detailed Description

This interface represents a space system for the inventory property class.

You can implement this to implement (for example) a 2D grid based system. Use iPcInventory->SetSpace() to set a space system on the inventory.

Definition at line 94 of file inv.h.

## Member Function Documentation

virtual bool iCelInventorySpace::AddEntity | ( | iCelEntity * | entity,
|  | iCelParameterBlock * | params |
| ) |  |  | `[pure virtual]`

Add an entity on a given slot.

The generic 'params' will be used to indicate the slot. It is up to the implementation of this interface to decide on how to use this. /return false if there is no room or if this is not allowed.

virtual bool iCelInventorySpace::AddEntity | ( | iCelEntity * | entity | ) | `[pure virtual]`

When some code calls old-style AddEntity() (with no parameters) on the iPcInventory then this function will be called.

We can pick a default slot or else reject this if a slot specification is always required. /return false if there is no room or if this is not allowed.

virtual iCelEntity* iCelInventorySpace::GetEntity | ( | iCelParameterBlock * | params | ) | `[pure virtual]`

Try to get a certain entity from a slot.

'params' is used to specify the slot and is implementation dependent.

virtual iCelInventorySpaceSlot* iCelInventorySpace::GetSlot | ( | iCelParameterBlock * | params | ) | `[pure virtual]`

Try to get a certain slot.

'params' is used to specify the slot and is implementation dependent.

virtual int iCelInventorySpace::GetSpaceLeft | ( |  | ) | const`[pure virtual]`

Return how much space is left.

virtual int iCelInventorySpace::GetSpaceTotal | ( |  | ) | const`[pure virtual]`

Return how much space is available in total.

virtual bool iCelInventorySpace::RemoveEntity | ( | iCelParameterBlock * | params | ) | `[pure virtual]`

Remove an entity (or entities) from the specified slot (through 'params').

If needed the params can be extended with information to specify the right item to be removed (for stacked items).

virtual bool iCelInventorySpace::RemoveEntity | ( | iCelEntity * | entity | ) | `[pure virtual]`

Remove the entity from its slot.

/return false if it couldn't be removed.

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

- propclass/inv.h