#include <CItem.h>
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? |
CItem::CItem | ( | void | ) |
Constructor (initialize the base class).
CItem::~CItem | ( | void | ) | [virtual] |
Destructor (uninitialize the base class).
void CItem::SetSprites | ( | void | ) | [private] |
Set the sprite numbers according to the item type.
void CItem::Create | ( | int | BlockX, | |
int | BlockY, | |||
EItemType | Type, | |||
bool | Fumes, | |||
bool | FlyingRandom | |||
) |
Initialize the item.
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.
void CItem::Destroy | ( | void | ) |
Uninitialize the item.
Reimplemented from CElement.
bool CItem::Update | ( | float | DeltaTime | ) | [virtual] |
Update the item and return whether the item should be deleted by the arena.
Implements CElement.
void CItem::Display | ( | void | ) | [virtual] |
Display the item.
Implements CElement.
void CItem::OnWriteSnapshot | ( | CArenaSnapshot & | Snapshot | ) | [virtual] |
void CItem::OnReadSnapshot | ( | CArenaSnapshot & | Snapshot | ) | [virtual] |
void CItem::Burn | ( | EBurnDirection | BurnDirection | ) |
Make the item react when an explosion hits this item. The direction of the hit is specified.
void CItem::Crush | ( | void | ) |
Make the item react when crushed by a wall.
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.
int CItem::GetBlockX | ( | void | ) | [inline] |
Return the block position X of the item.
int CItem::GetBlockY | ( | void | ) | [inline] |
Return the block position Y of the item.
bool CItem::IsBurning | ( | void | ) | [inline] |
Return whether the item is burning.
EItemType CItem::GetType | ( | void | ) | [inline] |
Return the type of the item.
bool CItem::IsFlying | ( | void | ) | [inline] |
Return whether the item is currently flying.
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?
EItemType CItem::m_Type [private] |
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.
EItemFlying CItem::m_Flying [private] |
Is the item currently flying and in which direction?
float CItem::m_FlyTime [private] |
How long (in seconds) has the item been flying?