Planeshift
psInventoryCache Class Reference

psinventorycache.h More...

#include <psinventorycache.h>

Classes

struct  CachedItemDescription
 

Public Member Functions

void EmptyInventory (void)
 Empty entire inventory. More...
 
bool EmptyInventoryItem (int slot, int container)
 Set empty slot. More...
 
csHash< CachedItemDescription * >::GlobalIterator GetHashIterator ()
 Return iterator to all cache items. More...
 
bool GetInventory (void)
 Requests inventory from server. More...
 
CachedItemDescriptionGetInventoryItem (int slot)
 Get item from container slot. More...
 
uint32 GetInventoryVersion () const
 inline uint32 GetInventoryVersion() const Info: Returns the cache version (PS#2691) More...
 
csArray< CachedItemDescription * >::Iterator GetSortedIterator ()
 Return iterator to all cache item sorted by slot. More...
 
bool MoveItem (int from_containerID, int from_slot, int to_containerID, int to_slot, int stackCount)
 Move items from one slot to another. More...
 
 psInventoryCache ()
 
bool SetInventoryItem (int slot, int containerID, csString name, csString meshName, csString materialName, float weight, float size, int stackCount, csString iconImage, int purifyStatus)
 Store an item in the inventory. More...
 
void SetInventoryVersion (uint32 ver)
 inline void SetInventoryVersion(uint32 ver) Info: Sets the cache version (PS#2691) More...
 
 ~psInventoryCache ()
 
- Public Member Functions inherited from psCache
CACHE_STATUS GetCacheStatus (void)
 Return cache status. More...
 
 psCache ()
 
void SetCacheStatus (CACHE_STATUS newStatus)
 Set cache status. More...
 
 ~psCache ()
 

Additional Inherited Members

- Public Types inherited from psCache
enum  CACHE_STATUS { INVALID, VALID }
 
- Protected Attributes inherited from psCache
CACHE_STATUS cacheStatus
 

Detailed Description

psinventorycache.h

Copyright (C) 2006 Atomic Blue (info@.nosp@m.plan.nosp@m.eshif.nosp@m.t.it, http://www.atomicblue.org)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation (version 2 of the License) This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Inventory cache for the client. The psInventoryCache class implements the inventory cache on the client.

Definition at line 27 of file psinventorycache.h.

Constructor & Destructor Documentation

psInventoryCache::psInventoryCache ( )
psInventoryCache::~psInventoryCache ( )

Member Function Documentation

void psInventoryCache::EmptyInventory ( void  )

Empty entire inventory.

bool psInventoryCache::EmptyInventoryItem ( int  slot,
int  container 
)

Set empty slot.

Parameters
slotSlot number
containerContainer id
Returns
bool Success flag
csHash<CachedItemDescription*>::GlobalIterator psInventoryCache::GetHashIterator ( )
inline

Return iterator to all cache items.

Definition at line 134 of file psinventorycache.h.

bool psInventoryCache::GetInventory ( void  )

Requests inventory from server.

Decides whether to request full inventory list or just updates the local cache.

Returns
bool success of inventory request
CachedItemDescription* psInventoryCache::GetInventoryItem ( int  slot)

Get item from container slot.

Parameters
slotSlot number
uint32 psInventoryCache::GetInventoryVersion ( ) const
inline

inline uint32 GetInventoryVersion() const Info: Returns the cache version (PS#2691)

Definition at line 118 of file psinventorycache.h.

csArray<CachedItemDescription*>::Iterator psInventoryCache::GetSortedIterator ( )
inline

Return iterator to all cache item sorted by slot.

Definition at line 142 of file psinventorycache.h.

bool psInventoryCache::MoveItem ( int  from_containerID,
int  from_slot,
int  to_containerID,
int  to_slot,
int  stackCount 
)

Move items from one slot to another.

Parameters
fromcontainerFrom container number
fromslotFrom slot number
Returns
bool Success flag
bool psInventoryCache::SetInventoryItem ( int  slot,
int  containerID,
csString  name,
csString  meshName,
csString  materialName,
float  weight,
float  size,
int  stackCount,
csString  iconImage,
int  purifyStatus 
)

Store an item in the inventory.

Parameters
slotSlot number
containerContainer id
nameItem name
meshNameItems mesh
materialNameItems material.
weightWeight of item
sizeSize of item
stackCountNumber of items in stack
iconImageThe item icon.
purifyStatusPurify status.
Returns
bool Success flag
void psInventoryCache::SetInventoryVersion ( uint32  ver)
inline

inline void SetInventoryVersion(uint32 ver) Info: Sets the cache version (PS#2691)

Definition at line 125 of file psinventorycache.h.


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