Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

pointers Namespace Reference

Pointer related stuff. More...


Maps declarations

Author:
Luxor


std::map< SERIAL, vector<
P_CHAR > > 
pStableMap
std::map< SERIAL, P_CHARpMounted
std::map< SERIAL, vector<
P_CHAR > > 
pOwnCharMap
std::map< SERIAL, vector<
P_ITEM > > 
pOwnItemMap
std::map< SERIAL, vector<
P_ITEM > > 
pContMap
std::map< SERIAL, vector<
P_CHAR > > 
pMultiCharMap
std::map< SERIAL, vector<
P_ITEM > > 
pMultiItemMap

Functions

void init ()
 initializes pointer maps

void updContMap (P_ITEM pi)
 updates containers map

void addToStableMap (P_CHAR pet)
void delFromStableMap (P_CHAR pet)
void addToOwnerMap (P_CHAR pet)
void delFromOwnerMap (P_CHAR pet)
void addToOwnerMap (P_ITEM pi)
void delFromOwnerMap (P_ITEM pi)
void addToMultiMap (P_CHAR pc)
void delFromMultiMap (P_CHAR pc)
void addToMultiMap (P_ITEM pi)
void delFromMultiMap (P_ITEM pi)
void eraseContainerInfo (SERIAL ser)
void delChar (P_CHAR pc)
 removes a char from chars pointer map and cleares its vector in pContMap

void delItem (P_ITEM pi)
 removes an item from items pointer and from the vector of his container

P_CHAR findCharBySerial (int serial)
 returns the corrispondent char of a serial

P_ITEM findItemBySerial (SERIAL serial)
 returns the corrispondent item of a serial

P_CHAR findCharBySerPtr (UI08 *p)
 returns the corrispondent char of a serial

P_ITEM findItemBySerPtr (unsigned char *p)
 returns the corrispondent item of a serial

P_ITEM containerSearch (int serial, int *index)
 returns the *index element of the vector of a container (identified by serial)

P_CHAR stableSearch (int serial, int *index)
P_ITEM containerSearchFor (const int serial, int *index, short id, short color)
 returns the *index element with the given id and color of the vector of a container(identified by serial)

UI32 containerCountItemsByType (SERIAL serial, UI32 type, LOGICAL bAddAmounts, LOGICAL recurseSubpack)
 returns the number of elements with the given type of the vector of a container (identified by serial)

UI32 containerCountItems (SERIAL serial, short id, short color, LOGICAL bAddAmounts, LOGICAL recurseSubpack)
 returns the number of elements with the given id and color of the vector of a container (identified by serial)

UI32 containerCountItemsByID (SERIAL serial, UI32 scriptID, LOGICAL bAddAmounts)
 returns the number of elements with the given scriptid of the vector of a container (identified by serial)

P_ITEM findItemBySerial (int serial)
P_CHAR findCharBySerPtr (unsigned char *p)


Detailed Description

Pointer related stuff.

Function Documentation

void pointers::addToMultiMap P_ITEM    pi
 

Author:
Endymion

void pointers::addToMultiMap P_CHAR    pc
 

Author:
Endymion

void pointers::addToOwnerMap P_ITEM    pi
 

Author:
Endymion

void pointers::addToOwnerMap P_CHAR    pet
 

Author:
Endymion

void pointers::addToStableMap P_CHAR    pet
 

Author:
Luxor

UI32 pointers::containerCountItems SERIAL    serial,
short    id,
short    color,
LOGICAL    bAddAmounts = true,
LOGICAL    recurseSubpack = true
 

returns the number of elements with the given id and color of the vector of a container (identified by serial)

Author:
Luxor
Returns:
the number of elements found
Parameters:
serial  the serial of the container
id  the id which we're searching for
color  the color which we're searching for
bAddAmounts  if true we want to add the amount of the items to the return value
recurseSubpack  if true we search also in subpack

UI32 pointers::containerCountItemsByID SERIAL    serial,
UI32    scriptID,
LOGICAL    bAddAmounts
 

returns the number of elements with the given scriptid of the vector of a container (identified by serial)

Author:
Luxor
Returns:
the number of elements found
Parameters:
serial  the serial of the container
scriptID  the scriptID which we're searching for
bAddAmounts  if true we want to add the amount of the items to the return value

UI32 pointers::containerCountItemsByType SERIAL    serial,
UI32    type,
LOGICAL    bAddAmounts = true,
LOGICAL    recurseSubpack = true
 

returns the number of elements with the given type of the vector of a container (identified by serial)

Author:
Wintermute
Returns:
the number of elements found
Parameters:
serial  the serial of the container
type  the type which we're searching for
color  the color which we're searching for
bAddAmounts  if true we want to add the amount of the items to the return value
recurseSubpack  if true we search also in subpack

P_ITEM pointers::containerSearch int    serial,
int *    index
 

returns the *index element of the vector of a container (identified by serial)

Author:
Luxor
Parameters:
serial  the serial of the container \index the pointer to the integer which we're using for the search
Note:
*index should be 0 at the beginning of the search
Returns:
P_ITEM of the item found

P_ITEM pointers::containerSearchFor const int    serial,
int *    index,
short    id,
short    color
 

returns the *index element with the given id and color of the vector of a container(identified by serial)

Author:
Luxor
Parameters:
serial  the serial of the container
index  the pointer to the integer which we're using for the search
id  the id which we're searching for
color  the color which we're searching for
Returns:
the item we're searching for
Note:
*index should be 0 at the beginning of the search

void pointers::delChar P_CHAR    pc
 

removes a char from chars pointer map and cleares its vector in pContMap

Parameters:
pc  the character
Author:
Luxor

void pointers::delFromMultiMap P_ITEM    pi
 

Author:
Endymion

void pointers::delFromMultiMap P_CHAR    pc
 

Author:
Endymion

void pointers::delFromOwnerMap P_ITEM    pi
 

Author:
Endymion

void pointers::delFromOwnerMap P_CHAR    pet
 

Author:
Endymion

void pointers::delFromStableMap P_CHAR    pet
 

Author:
Luxor

void pointers::delItem P_ITEM    pi
 

removes an item from items pointer and from the vector of his container

Author:
Luxor
Parameters:
pi  the item

void eraseContainerInfo SERIAL    ser
 

P_CHAR pointers::findCharBySerial int    serial
 

returns the corrispondent char of a serial

Author:
Luxor
Returns:
the corrispondent char of the serial passed in the params
Parameters:
serial  the serial of the char which we're searching for

P_CHAR findCharBySerPtr unsigned char *    p
 

P_CHAR findCharBySerPtr UI08   p
 

returns the corrispondent char of a serial

Parameters:
p  the pointer to serial
Author:
Luxor
Returns:
the char we're looking for

P_ITEM findItemBySerial int    serial
 

P_ITEM findItemBySerial SERIAL    serial
 

returns the corrispondent item of a serial

Author:
Luxor
Returns:
the corrispondent item of the serial passed in the params
Parameters:
serial  the serial of the item which we're searching for

P_ITEM pointers::findItemBySerPtr unsigned char *    p
 

returns the corrispondent item of a serial

Author:
Luxor
Parameters:
p  the pointer to serial
Returns:
P_ITEM of the found item
Author:
Luxor

void pointers::init  
 

initializes pointer maps

Author:
Luxor

P_CHAR pointers::stableSearch int    serial,
int *    index
 

void pointers::updContMap P_ITEM    pi
 

updates containers map

Author:
Luxor
Parameters:
pi  the item which the function will update in the containers map


Variable Documentation

std::map< SERIAL, vector< P_ITEM > > pointers::pContMap
 

std::map< SERIAL, P_CHAR > pointers::pMounted
 

std::map< SERIAL, vector< P_CHAR > > pointers::pMultiCharMap
 

std::map< SERIAL, vector< P_ITEM > > pointers::pMultiItemMap
 

std::map< SERIAL, vector< P_CHAR > > pointers::pOwnCharMap
 

std::map< SERIAL, vector< P_ITEM > > pointers::pOwnItemMap
 

std::map< SERIAL, vector< P_CHAR > > pointers::pStableMap
 

SourceForge.net Logo