Planeshift
Classes | Public Member Functions | Protected Member Functions | Protected Attributes

gemContainer Class Reference

gemContainers are the public containers in the world for crafting, like forges or ovens. More...

#include <gem.h>

List of all members.

Classes

class  psContainerIterator

Public Member Functions

bool AddToContainer (psItem *item, Client *fromClient, int slot=-1)
bool CanAdd (unsigned short amountToAdd, psItem *item, int slot, csString &reason)
 Check if a item can be added to a container.
bool CanTake (Client *client, psItem *item)
 Checks if client is allowed to remove an item from the container.
void CleareWithoutDelete ()
 Clear list of items without delting them.
size_t CountItems ()
psItemFindItemInSlot (int slot, int stackCount=-1)
 gemContainer (GEMSupervisor *gemSupervisor, CacheManager *cachemanager, EntityManager *entitymanager, psItem *item, const char *factname, InstanceID myInstance, iSector *room, const csVector3 &pos, float xrotangle, float yrotangle, float zrotangle, int clientnum)
psItemGetIndexItem (size_t i)
psItemRemoveFromContainer (psItem *itemStack, int fromSlot, Client *fromClient, int stackCount)
 Remove an item from the container.
bool RemoveFromContainer (psItem *item, Client *fromClient)
int SlotCount ()
 ~gemContainer ()

Protected Member Functions

bool AddToContainer (psItem *item, Client *fromClient, int slot, bool test)

Protected Attributes

csArray< psItem * > itemlist

Detailed Description

gemContainers are the public containers in the world for crafting, like forges or ovens.

Regular containers in inventory, like sacks, are simulated by psCharInventory.

Definition at line 931 of file gem.h.


Constructor & Destructor Documentation

gemContainer::gemContainer ( GEMSupervisor gemSupervisor,
CacheManager cachemanager,
EntityManager entitymanager,
psItem item,
const char *  factname,
InstanceID  myInstance,
iSector *  room,
const csVector3 &  pos,
float  xrotangle,
float  yrotangle,
float  zrotangle,
int  clientnum 
)
gemContainer::~gemContainer ( )

Member Function Documentation

bool gemContainer::AddToContainer ( psItem item,
Client fromClient,
int  slot,
bool  test 
) [protected]
bool gemContainer::AddToContainer ( psItem item,
Client fromClient,
int  slot = -1 
) [inline]

Definition at line 963 of file gem.h.

bool gemContainer::CanAdd ( unsigned short  amountToAdd,
psItem item,
int  slot,
csString &  reason 
)

Check if a item can be added to a container.

bool gemContainer::CanTake ( Client client,
psItem item 
)

Checks if client is allowed to remove an item from the container.

Parameters:
clientA pointer to the client viewing the container
itemItem being viewed or taken
Returns:
boolean indicating if client is allowed to take the item
void gemContainer::CleareWithoutDelete ( )

Clear list of items without delting them.

Used when item is moved from world to inventory.

size_t gemContainer::CountItems ( ) [inline]

Definition at line 997 of file gem.h.

psItem* gemContainer::FindItemInSlot ( int  slot,
int  stackCount = -1 
)
psItem* gemContainer::GetIndexItem ( size_t  i) [inline]

Definition at line 1001 of file gem.h.

psItem* gemContainer::RemoveFromContainer ( psItem itemStack,
int  fromSlot,
Client fromClient,
int  stackCount 
)

Remove an item from the container.

Parameters:
itemStackA pointer to the complete stack of the items we are looking at.
fromSlotWhere in the container the items are removed from.
fromClientThe client that is removing the items.
stackCountThe amount of items we want to remove.
Returns:
An item pointer that is the removed items from container. If itemStack == the item returned then the entire stack has been removed. Otherwise it will be a new item instance.
bool gemContainer::RemoveFromContainer ( psItem item,
Client fromClient 
)
int gemContainer::SlotCount ( ) [inline]

Definition at line 993 of file gem.h.


Member Data Documentation

Definition at line 934 of file gem.h.


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