Planeshift
Classes | Public Member Functions

psInventoryCache Class Reference

psinventorycache.h More...

#include <psinventorycache.h>

List of all members.

Classes

struct  CachedItemDescription

Public Member Functions

void EmptyInventory (void)
 Empty entire inventory.
bool EmptyInventoryItem (int slot, int container)
 Set empty slot.
csHash< CachedItemDescription * >
::GlobalIterator 
GetHashIterator ()
 Return iterator to all cache items.
bool GetInventory (void)
 Requests inventory from server.
CachedItemDescriptionGetInventoryItem (int slot)
 Get item from container slot.
uint32 GetInventoryVersion () const
 inline uint32 GetInventoryVersion() const Info: Returns the cache version (PS#2691)
csArray< CachedItemDescription * >
::Iterator 
GetSortedIterator ()
 Return iterator to all cache item sorted by slot.
bool MoveItem (int from_containerID, int from_slot, int to_containerID, int to_slot, int stackCount)
 Move items from one slot to another.
 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.
void SetInventoryVersion (uint32 ver)
 inline void SetInventoryVersion(uint32 ver) Info: Sets the cache version (PS#2691)
 ~psInventoryCache ()

Detailed Description

psinventorycache.h

Copyright (C) 2006 Atomic Blue ([email protected], 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
container,:Container 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:
slot,:Slot 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: