CItem Class Reference

An element in the arena which represents an item. More...

#include <CItem.h>

Inheritance diagram for CItem:

Inheritance graph
[legend]
Collaboration diagram for CItem:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CItem (void)
 Constructor (initialize the base class).
virtual ~CItem (void)
 Destructor (uninitialize the base class).
void Create (int BlockX, int BlockY, EItemType Type, bool Fumes, bool FlyingRandom)
 Initialize the item.
void Destroy (void)
 Uninitialize the item.
bool Update (float DeltaTime)
 Update the item and return whether the item should be deleted by the arena.
void Display (void)
 Display the item.
void OnWriteSnapshot (CArenaSnapshot &Snapshot)
void OnReadSnapshot (CArenaSnapshot &Snapshot)
void Burn (EBurnDirection BurnDirection)
 Make the item react when an explosion hits this item. The direction of the hit is specified.
void Crush (void)
 Make the item react when crushed by a wall.
int GetBlockX (void)
 Return the block position X of the item.
int GetBlockY (void)
 Return the block position Y of the item.
bool IsBurning (void)
 Return whether the item is burning.
EItemType GetType (void)
 Return the type of the item.
bool IsFlying (void)
 Return whether the item is currently flying.

Static Public Member Functions

static bool CreateItems (CArena *pArena, EItemPlace ItemPlace, int NumberOfItemBombs, int NumberOfItemFlames, int NumberOfItemRollers, int NumberOfItemKicks, int NumberOfItemSkulls, int NumberOfItemThrow, int NumberOfItemPunch, int NumberOfItemRemote)
 Create the specified amount of items in an arena, in the specified EItemPlace.

Private Member Functions

void SetSprites (void)
 Set the sprite numbers according to the item type.

Private Attributes

float m_fX
 Float position X (in pixels) in the arena.
float m_fY
 Float position Y (in pixels) in the arena.
int m_iX
 Integer position X (in pixels) in the arena.
int m_iY
 Integer position Y (in pixels) in the arena.
int m_BlockX
 Position X (in blocks) in the arena grid.
int m_BlockY
 Position Y (in blocks) in the arena grid.
int m_Sprite
 Current item sprite to use when displaying the item.
int m_Sprite0
 First sprite number of the item flash animation.
int m_Sprite1
 Second sprite number of the item flash animation.
float m_Timer
 Time counter for animation.
bool m_Dead
 Should the item be deleted by the arena?
bool m_Burning
 Is the item burning?
EItemType m_Type
 Type of this item.
bool m_Fumes
 Is the fumes animation playing?
int m_FumeSprite
 Current fume frame number to use to get each fume sprite number.
EItemFlying m_Flying
 Is the item currently flying and in which direction?
float m_FlyTime
 How long (in seconds) has the item been flying?


Detailed Description

An element in the arena which represents an item.

Constructor & Destructor Documentation

CItem::CItem ( void   ) 

Constructor (initialize the base class).

CItem::~CItem ( void   )  [virtual]

Destructor (uninitialize the base class).


Member Function Documentation

void CItem::SetSprites ( void   )  [private]

Set the sprite numbers according to the item type.

Here is the caller graph for this function:

void CItem::Create ( int  BlockX,
int  BlockY,
EItemType  Type,
bool  Fumes,
bool  FlyingRandom 
)

Initialize the item.

Parameters:
BlockX the x coordinate in the arena where the item should be created
BlockY the y coordinate in the arena where the item should be created
Type the item type
Fumes fumes (??) TODO!
FlyingRandom is true, if the item should fly

There cannot be fumes if the item must fly.

Here is the call graph for this function:

Here is the caller graph for this function:

void CItem::Destroy ( void   ) 

Uninitialize the item.

Reimplemented from CElement.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CItem::Update ( float  DeltaTime  )  [virtual]

Update the item and return whether the item should be deleted by the arena.

Implements CElement.

Here is the call graph for this function:

Here is the caller graph for this function:

void CItem::Display ( void   )  [virtual]

Display the item.

Implements CElement.

Here is the call graph for this function:

Here is the caller graph for this function:

void CItem::OnWriteSnapshot ( CArenaSnapshot Snapshot  )  [virtual]

Implements CElement.

Here is the call graph for this function:

void CItem::OnReadSnapshot ( CArenaSnapshot Snapshot  )  [virtual]

Implements CElement.

Here is the call graph for this function:

void CItem::Burn ( EBurnDirection  BurnDirection  ) 

Make the item react when an explosion hits this item. The direction of the hit is specified.

Here is the caller graph for this function:

void CItem::Crush ( void   ) 

Make the item react when crushed by a wall.

Here is the caller graph for this function:

bool CItem::CreateItems ( CArena pArena,
EItemPlace  ItemPlace,
int  NumberOfItemBombs,
int  NumberOfItemFlames,
int  NumberOfItemRollers,
int  NumberOfItemKicks,
int  NumberOfItemSkulls,
int  NumberOfItemThrow,
int  NumberOfItemPunch,
int  NumberOfItemRemote 
) [static]

Create the specified amount of items in an arena, in the specified EItemPlace.

Creates a bunch of items in the arena, according to the place where items should be (on the floor, under walls...), and how many items of each type to create. This is used by the arena when building a new arena, and by bombers that return the items they pick when they die. Returns whether at least one item was created.

See also:
CArena::Create()

Here is the call graph for this function:

Here is the caller graph for this function:

int CItem::GetBlockX ( void   )  [inline]

Return the block position X of the item.

Here is the caller graph for this function:

int CItem::GetBlockY ( void   )  [inline]

Return the block position Y of the item.

Here is the caller graph for this function:

bool CItem::IsBurning ( void   )  [inline]

Return whether the item is burning.

EItemType CItem::GetType ( void   )  [inline]

Return the type of the item.

Here is the caller graph for this function:

bool CItem::IsFlying ( void   )  [inline]

Return whether the item is currently flying.

Here is the caller graph for this function:


Member Data Documentation

float CItem::m_fX [private]

Float position X (in pixels) in the arena.

float CItem::m_fY [private]

Float position Y (in pixels) in the arena.

int CItem::m_iX [private]

Integer position X (in pixels) in the arena.

int CItem::m_iY [private]

Integer position Y (in pixels) in the arena.

int CItem::m_BlockX [private]

Position X (in blocks) in the arena grid.

int CItem::m_BlockY [private]

Position Y (in blocks) in the arena grid.

int CItem::m_Sprite [private]

Current item sprite to use when displaying the item.

int CItem::m_Sprite0 [private]

First sprite number of the item flash animation.

int CItem::m_Sprite1 [private]

Second sprite number of the item flash animation.

float CItem::m_Timer [private]

Time counter for animation.

bool CItem::m_Dead [private]

Should the item be deleted by the arena?

bool CItem::m_Burning [private]

Is the item burning?

Type of this item.

bool CItem::m_Fumes [private]

Is the fumes animation playing?

int CItem::m_FumeSprite [private]

Current fume frame number to use to get each fume sprite number.

Is the item currently flying and in which direction?

float CItem::m_FlyTime [private]

How long (in seconds) has the item been flying?


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

Generated on Sat Oct 18 12:26:46 2008 for Bombermaaan by  doxygen 1.5.5
Visit the Bombermaaan project page
SourceForge.net Logo