hoa_global::GlobalObject Class Reference

An abstract parent class for representing a game object. More...

#include <global_objects.h>

Inheritance diagram for hoa_global::GlobalObject:

Inheritance graph
[legend]
Collaboration diagram for hoa_global::GlobalObject:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void DecrementCount (uint32 count=1)
 Decrements the number of objects represented by the specified amount.
virtual GLOBAL_OBJECT GetObjectType () const=0
 Purely virtual function used to distinguish between object types.
 GlobalObject (uint32 id, uint32 count)
 GlobalObject ()
void IncrementCount (uint32 count=1)
 Increments the number of objects represented by the specified amount.
virtual ~GlobalObject ()
Class Member Access Functions
uint32 GetCount () const
hoa_utils::ustring GetDescription () const
const hoa_video::StillImageGetIconImage () const
uint32 GetID () const
hoa_utils::ustring GetName () const
uint32 GetPrice () const
void SetCount (uint32 count)

Protected Attributes

uint32 _count
 How many occurences of the object are represented by this class object instance.
hoa_utils::ustring _description
 A short description of the item to display on the screen.
hoa_video::StillImage _icon_image
 The image icon of the object.
uint32 _id
 An identification number for each unique item.
hoa_utils::ustring _name
 The name of the object as it would be displayed on a screen.
uint32 _price
 The listed price of the object in the game's markets.

Detailed Description

An abstract parent class for representing a game object.

****************************************************************************

This class serves as a way for the various game objects to share the same code, although it may also be used to keep a collection of pointers that point to different game objects that inherit from this class.

Note:
Each class object (or inherited class object) is designed so that multiple numbers of the same object can be represented by only a single class object. In other words, 50 healing potions are represented by only a single class instance

Definition at line 98 of file global_objects.h.


Constructor & Destructor Documentation

hoa_global::GlobalObject::GlobalObject (  )  [inline]

Definition at line 100 of file global_objects.h.

hoa_global::GlobalObject::GlobalObject ( uint32  id,
uint32  count 
) [inline]

Definition at line 103 of file global_objects.h.

virtual hoa_global::GlobalObject::~GlobalObject (  )  [inline, virtual]

Definition at line 106 of file global_objects.h.


Member Function Documentation

void hoa_global::GlobalObject::DecrementCount ( uint32  count = 1  )  [inline]

Decrements the number of objects represented by the specified amount.

Parameters:
count The number of objects to remove (default value == 1)
Note:
When the count reaches zero, this class object will not self-destruct. It is the user's responsiblity to check if the count becomes zero, and to destroy the object if it is appropriate to do so.

Definition at line 125 of file global_objects.h.

References _count.

Referenced by hoa_battle::BattleMode::_UpdateAttackPointSelection(), hoa_battle::BattleMode::_UpdateTargetSelection(), and hoa_menu::private_menu::InventoryWindow::Update().

uint32 hoa_global::GlobalObject::GetCount (  )  const [inline]

Definition at line 139 of file global_objects.h.

References _count.

Referenced by hoa_battle::private_battle::ActionWindow::_ConstructActionSelectionList(), hoa_menu::private_menu::InventoryWindow::_UpdateItemText(), hoa_global::GameGlobal::AddToInventory(), and hoa_battle::private_battle::ScriptEvent::RunScript().

hoa_utils::ustring hoa_global::GlobalObject::GetDescription (  )  const [inline]

Definition at line 136 of file global_objects.h.

References _description.

Referenced by hoa_shop::private_shop::ObjectInfoWindow::SetObject().

const hoa_video::StillImage& hoa_global::GlobalObject::GetIconImage (  )  const [inline]

Definition at line 148 of file global_objects.h.

References _icon_image.

Referenced by hoa_menu::private_menu::EquipWindow::_UpdateEquipList(), hoa_menu::private_menu::InventoryWindow::_UpdateItemText(), hoa_shop::private_shop::ObjectInfoWindow::Draw(), hoa_menu::private_menu::InventoryWindow::Draw(), and hoa_menu::private_menu::EquipWindow::EquipWindow().

uint32 hoa_global::GlobalObject::GetID (  )  const [inline]

Definition at line 130 of file global_objects.h.

References _id.

Referenced by hoa_global::GameGlobal::_SaveCharacter(), hoa_global::GameGlobal::AddToInventory(), and hoa_battle::private_battle::ScriptEvent::RunScript().

hoa_utils::ustring hoa_global::GlobalObject::GetName (  )  const [inline]

Definition at line 133 of file global_objects.h.

References _name.

Referenced by hoa_battle::private_battle::ActionWindow::_ConstructActionSelectionList(), hoa_menu::private_menu::EquipWindow::_UpdateEquipList(), hoa_menu::private_menu::InventoryWindow::_UpdateItemText(), hoa_shop::private_shop::ObjectInfoWindow::Draw(), and hoa_menu::private_menu::InventoryWindow::Draw().

virtual GLOBAL_OBJECT hoa_global::GlobalObject::GetObjectType (  )  const [pure virtual]

Purely virtual function used to distinguish between object types.

Returns:
A value that represents the type of object

Implemented in hoa_global::GlobalItem, hoa_global::GlobalWeapon, hoa_global::GlobalArmor, hoa_global::GlobalShard, and hoa_global::GlobalKeyItem.

Referenced by hoa_shop::private_shop::ObjectInfoWindow::SetObject(), and hoa_menu::private_menu::InventoryWindow::Update().

uint32 hoa_global::GlobalObject::GetPrice (  )  const [inline]

Definition at line 145 of file global_objects.h.

References _price.

void hoa_global::GlobalObject::IncrementCount ( uint32  count = 1  )  [inline]

Increments the number of objects represented by the specified amount.

Parameters:
count The number of objects to add (default value == 1)

Definition at line 117 of file global_objects.h.

References _count.

void hoa_global::GlobalObject::SetCount ( uint32  count  )  [inline]

Definition at line 142 of file global_objects.h.

References _count.


Member Data Documentation

uint32 hoa_global::GlobalObject::_count [protected]

How many occurences of the object are represented by this class object instance.

Definition at line 165 of file global_objects.h.

Referenced by hoa_global::GlobalItem::BattleUse(), DecrementCount(), GetCount(), IncrementCount(), hoa_global::GlobalItem::MenuUse(), and SetCount().

hoa_utils::ustring hoa_global::GlobalObject::_description [protected]

A short description of the item to display on the screen.

Definition at line 162 of file global_objects.h.

Referenced by GetDescription(), hoa_global::GlobalArmor::GlobalArmor(), hoa_global::GlobalItem::GlobalItem(), and hoa_global::GlobalWeapon::GlobalWeapon().

hoa_video::StillImage hoa_global::GlobalObject::_icon_image [protected]

The image icon of the object.

Definition at line 171 of file global_objects.h.

Referenced by GetIconImage(), hoa_global::GlobalArmor::GlobalArmor(), hoa_global::GlobalItem::GlobalItem(), and hoa_global::GlobalWeapon::GlobalWeapon().

uint32 hoa_global::GlobalObject::_id [protected]

An identification number for each unique item.

Note:
An ID number of zero indicates an invalid object

Definition at line 156 of file global_objects.h.

Referenced by hoa_global::GlobalItem::BattleUse(), GetID(), hoa_global::GlobalArmor::GetObjectType(), hoa_global::GlobalArmor::GlobalArmor(), hoa_global::GlobalItem::GlobalItem(), hoa_global::GlobalWeapon::GlobalWeapon(), and hoa_global::GlobalItem::MenuUse().

hoa_utils::ustring hoa_global::GlobalObject::_name [protected]

The name of the object as it would be displayed on a screen.

Definition at line 159 of file global_objects.h.

Referenced by GetName(), hoa_global::GlobalArmor::GlobalArmor(), hoa_global::GlobalItem::GlobalItem(), and hoa_global::GlobalWeapon::GlobalWeapon().

uint32 hoa_global::GlobalObject::_price [protected]

The listed price of the object in the game's markets.

Definition at line 168 of file global_objects.h.

Referenced by GetPrice(), hoa_global::GlobalArmor::GlobalArmor(), hoa_global::GlobalItem::GlobalItem(), and hoa_global::GlobalWeapon::GlobalWeapon().


The documentation for this class was generated from the following file:
Generated on Fri Jul 6 23:14:22 2007 for Hero of Allacrost by  doxygen 1.5.1