CGameContainer Class¶
The structure used for this class is CGameContainer
Quick Ref |
void CGameContainer::CGameContainer(CGameArea* pArea, CRect& rBound) |
void CGameContainer::CGameContainer(CGameArea* pArea, CAreaFileContainer* pContainerObject, CAreaPoint* pPoints, unsigned short maxPts, CCreatureFileItem* pItems, unsigned long maxItems) |
virtual void CGameContainer::~CGameContainer() |
virtual void CGameContainer::AIUpdate() |
virtual void CGameContainer::AddEffect(CGameEffect* pEffect, unsigned char list, int noSave, int immediateApply) |
virtual unsigned char CGameContainer::CanSaveGame(unsigned long& strError, int restCheck, int combatCheck) |
void CGameContainer::CompressContainer() |
virtual unsigned char CGameContainer::CompressTime(unsigned long deltaTime) |
short CGameContainer::CountItem(CResRef& res) |
virtual void CGameContainer::DebugDump(CString& message, unsigned char bEchoToScreen) |
virtual unsigned char CGameContainer::DoAIUpdate(unsigned char active, long counter) |
short CGameContainer::FindItemSlot(CResRef& res) |
virtual CRect CGameContainer::GetBounding() |
CItem* CGameContainer::GetItem(short nSlotNum) |
virtual short CGameContainer::GetNPoly() |
short CGameContainer::GetNumTrueItems() |
virtual CPoint* CGameContainer::GetPoly() |
unsigned char CGameContainer::HasItemType(unsigned long type) |
unsigned char CGameContainer::HasItemWithFlag(unsigned long flag, int ignoreDestructible) |
virtual int CGameContainer::IsOver(CPoint& pt) |
void CGameContainer::Marshal(SAreaFileWrapper* pContainerWrapper) |
void CGameContainer::MarshalMessage(unsigned char** pData, unsigned long* dwSize) |
virtual void CGameContainer::OnActionButton(CPoint& pt) |
void CGameContainer::OpenContainer(CAIObjectType& user) |
void CGameContainer::PlaceAllGold(unsigned long gold) |
unsigned char CGameContainer::PlaceItemInBlankSlot(CItem* pItem, unsigned char bCompressContainer, short nRecommendedSlotNum, int useMessage) |
void CGameContainer::RefreshRenderPile() |
virtual void CGameContainer::Render(CGameArea* pArea, CVidMode* pVidMode) |
virtual void CGameContainer::SetCursor(long nToolTip) |
void CGameContainer::SetDrawPoly(short time) |
void CGameContainer::SetFlags(unsigned long dwFlags) |
void CGameContainer::SetItem(short nSlotNum, CItem* pItem) |
void CGameContainer::SetTrapActivated(unsigned short active) |
void CGameContainer::SetTrapDetected(unsigned short state) |
unsigned long CGameContainer::TakeAllGold() |
void CGameContainer::TakeCreatureItems(CGameSprite* pSprite, int Type) |
virtual void CGameContainer::RemoveFromArea() |
Constructors¶
Name |
Description |
Constructs a |
|
Destroys a |
CGameContainer::CGameContainer¶
Constructs a CGameContainer
object
void CGameContainer::CGameContainer(
CGameArea* pArea,
CRect& rBound);
Parameters
CGameArea* pArea - pointer to area
CRect& rBound - bounding rectanble of the container to add to area
Remarks
Constructs a CGameContainer
object
CGameContainer::CGameContainer¶
Constructs a CGameContainer
object
void CGameContainer::CGameContainer(
CGameArea* pArea,
CAreaFileContainer* pContainerObject,
CAreaPoint* pPoints,
unsigned short maxPts,
CCreatureFileItem* pItems,
unsigned long maxItems);
Parameters
CGameArea* pArea - pointer to area
CAreaFileContainer* pContainerObject - pointer to container object
CAreaPoint* pPoints - pointer to array of points used for polygon to highlight container
unsigned short
maxPts - count of points in array for polygonCCreatureFileItem* pItems - pointer to array of items to add to container
unsigned long
maxItems - count of items in array to add to container
Remarks
Constructs a CGameContainer
object
CGameContainer::~CGameContainer¶
Destroys the CGameContainer
object
virtual void CGameContainer::~CGameContainer();
Remarks
Destroys the CGameContainer
object
Methods¶
Name |
Description |
Add a game effect to a container |
|
Returns the number of items in container |
|
Debug message from container class |
|
Return the slot id for a specific item in a container |
|
Get the bounding rectangle for the container |
|
Return an item from a specified slot in a container |
|
Returns no of polygons points for the container |
|
Returns a pointer to an array of points which define the container polygon |
|
Determines if a container contains a specific item type |
|
Determines if a container contains a specific item type with an item flag |
|
Determines if mouse position is over the container |
|
Event action for when mouse is clicked on the container |
|
Opens container by the specified character |
|
Takes gold and places the specified amount into the shared party gold stash |
|
Places an item into a blank slot of the container |
|
Set the cursor and tooltip when mouse is over the container |
|
Set container flags |
|
Set an item in a container slot |
|
Sets or clears if a trap is activated on the container |
|
Sets if a trap on a container has been detected yet |
|
Take all gold |
|
Take items from a creature |
|
Remove from area |
CGameContainer::AIUpdate¶
virtual void CGameContainer::AIUpdate();
Remarks
CGameContainer::AddEffect¶
Add a game effect to a container
virtual void CGameContainer::AddEffect(
CGameEffect* pEffect,
unsigned char list,
int noSave,
int immediateApply);
Parameters
CGameEffect* pEffect - pointer to game effect to add to container
unsigned char
list -int
noSave - if a saving throw is allowed to avoid or reduce effect if trap is triggeredint
immediateApply - if the effect is immediate or delayed
Remarks
Used for setting trap effects on containers, eg. fireball, lightning, poison, or piercing, slashing damage etc
CGameContainer::CanSaveGame¶
virtual unsigned char CGameContainer::CanSaveGame(
unsigned long& strError,
int restCheck,
int combatCheck);
Parameters
unsigned long
& strError -int
restCheck -int
combatCheck -
Return Value
Returns unsigned char
Remarks
CGameContainer::CompressContainer¶
void CGameContainer::CompressContainer();
Remarks
CGameContainer::CompressTime¶
virtual unsigned char CGameContainer::CompressTime(unsigned long deltaTime);
Parameters
unsigned long
deltaTime -
Return Value
Returns unsigned char
Remarks
CGameContainer::CountItem¶
Returns the number of items in container
short CGameContainer::CountItem(CResRef& res)
Parameters
CResRef& res - resource reference of the container to return count of items for
Return Value
Returns a short
value reprenting the number of items in the container
Remarks
CGameContainer::DebugDump¶
Debug message from container class
virtual void CGameContainer::DebugDump(
CString& message,
unsigned char bEchoToScreen);
Parameters
CString& message - debug message to output to console
unsigned char
bEchoToScreen - output debug message to screen as well as console
Remarks
CGameContainer::DoAIUpdate¶
virtual unsigned char CGameContainer::DoAIUpdate(
unsigned char active,
long counter);
Parameters
unsigned char
active -long
counter -
Return Value
Returns unsigned char
Remarks
CGameContainer::FindItemSlot¶
Return the slot id for a specific item in a container
short CGameContainer::FindItemSlot(CResRef& res);
Parameters
CResRef& res - resource reference of item in container
Return Value
Returns a short
value representing the slot id for the item in a container
Remarks
Does this return 0 or -1 if item not found in container ?
CGameContainer::GetBounding¶
Get the bounding rectangle for the container
virtual CRect CGameContainer::GetBounding();
Return Value
Returns a CRect which defines the bounding dimensions of the container
Remarks
CGameContainer::GetItem¶
Return an item from a specified slot in a container
CItem* CGameContainer::GetItem(short nSlotNum);
Parameters
short
nSlotNum - slot id to return the item associated with this slot
Return Value
Returns CItem*
Remarks
CGameContainer::GetNPoly¶
Returns the number of polygons points for the container
virtual short CGameContainer::GetNPoly();
Return Value
Returns a short
value indicating no of points that define the containers polygon
Remarks
Polygons are used when highlighting containers with a bright colored outline
See also CGameContainer::GetPoly and CGameContainer::SetDrawPoly
CGameContainer::GetNumTrueItems¶
short CGameContainer::GetNumTrueItems();
Return Value
Returns short
Remarks
CGameContainer::GetPoly¶
Returns a pointer to an array of points which define the container polygon
virtual CPoint* CGameContainer::GetPoly();
Return Value
Returns CPoint*, an array of points which define the container polygon
Remarks
Polygons are used when highlighting containers with a bright colored outline
See also CGameContainer::GetNPoly and CGameContainer::SetDrawPoly
CGameContainer::HasItemType¶
Determines if a container contains a specific item type
unsigned char CGameContainer::HasItemType(unsigned long type);
Parameters
unsigned long
type - the type of item to check for
Return Value
Returns unsigned char
Remarks
CGameContainer::HasItemWithFlag¶
Determines if a container contains a specific item type with an item flag
unsigned char CGameContainer::HasItemWithFlag(
unsigned long flag,
int ignoreDestructible);
Parameters
unsigned long
flag - item flag to check forint
ignoreDestructible - ignore destructible items
Return Value
Returns unsigned char
Remarks
CGameContainer::IsOver¶
Determines if mouse position is over the container
virtual int CGameContainer::IsOver(CPoint& pt);
Parameters
CPoint& pt - x and y coordinates of the mouse position
Return Value
Returns an int
value representing 1
true, or 0
false
Remarks
CGameContainer::Marshal¶
void CGameContainer::Marshal(SAreaFileWrapper* pContainerWrapper);
Parameters
SAreaFileWrapper* pContainerWrapper -
Remarks
CGameContainer::MarshalMessage¶
void CGameContainer::MarshalMessage(
unsigned char** pData,
unsigned long* dwSize);
Parameters
unsigned char
** pData - pointer to dataunsigned long
* dwSize - size of data
Remarks
CGameContainer::OpenContainer¶
Opens container by the specified character
void CGameContainer::OpenContainer(CAIObjectType& user);
Parameters
CAIObjectType& user - character that opens the container
Remarks
CGameContainer::PlaceAllGold¶
Takes gold and places the specified amount into the shared party gold stash
void CGameContainer::PlaceAllGold(unsigned long gold);
Parameters
unsigned long
gold - amount of gold
Remarks
CGameContainer::PlaceItemInBlankSlot¶
Places an item into a blank slot of the container
unsigned char CGameContainer::PlaceItemInBlankSlot(
CItem* pItem,
unsigned char bCompressContainer,
short nRecommendedSlotNum,
int useMessage);
Parameters
CItem* pItem - item to place in container
unsigned char
bCompressContainer - if the container should be compressedshort
nRecommendedSlotNum - the slot id to place the item into the container atint
useMessage -
Return Value
Returns unsigned char
Remarks
CGameContainer::RefreshRenderPile¶
void CGameContainer::RefreshRenderPile();
Remarks
CGameContainer::Render¶
virtual void CGameContainer::Render(
CGameArea* pArea,
CVidMode* pVidMode);
Parameters
Remarks
CGameContainer::SetCursor¶
Set the cursor and tooltip when mouse is over the container
virtual void CGameContainer::SetCursor(long nToolTip);
Parameters
long
nToolTip - pointer to tooltip text?
Remarks
CGameContainer::SetDrawPoly¶
void CGameContainer::SetDrawPoly(short time);
Parameters
short
time - time value
Remarks
Polygons are used when highlighting containers with a bright colored outline
See also CGameContainer::GetNPoly and CGameContainer::GetPoly
CGameContainer::SetFlags¶
Set container flags
void CGameContainer::SetFlags(unsigned long dwFlags);
Parameters
unsigned long
dwFlags - flags to set for container
Remarks
CGameContainer::SetItem¶
Set an item in a container slot
void CGameContainer::SetItem(
short nSlotNum,
CItem* pItem);
Parameters
short
nSlotNum - slot id to set item forCItem* pItem - pointer to item to associate with this slot id
Remarks
CGameContainer::SetTrapActivated¶
Sets or clears if a trap is activated on the container
void CGameContainer::SetTrapActivated(unsigned short active);
Parameters
unsigned short
active - trap activated state
Remarks
if trap is to be activated or already sprung, or not enabled
CGameContainer::SetTrapDetected¶
Sets if a trap on a container has been detected yet
void CGameContainer::SetTrapDetected(unsigned short state);
Parameters
unsigned short
state - trap detected state
Remarks
CGameContainer::TakeAllGold¶
Take all gold
unsigned long CGameContainer::TakeAllGold();
Return Value
Returns unsigned long
Remarks
CGameContainer::TakeCreatureItems¶
Take items from a creature
void CGameContainer::TakeCreatureItems(
CGameSprite* pSprite,
int Type);
Parameters
CGameSprite* pSprite - pointer to creature to take items from
int
Type - type of item to take
Remarks
Typically a dead creature is seen as a container for looting purposes.
CGameContainer::RemoveFromArea¶
Remove from area
virtual void CGameContainer::RemoveFromArea();
Remarks