◆ Powerup()
Constructor, stores the kart to which this powerup belongs.
- Parameters
-
| kart | The kart to which this powerup belongs. |
◆ getIcon()
Returns the icon for the currently collected powerup.
Used in the race_gui to display the collected item.
◆ hitBonusBox()
| void Powerup::hitBonusBox |
( |
const ItemState & |
item_state | ) |
|
This function is called when a bnous box is it.
This function can be called on a server (in which case item and add_info are not used), or on a client, in which case the item and additional info is used to make sure server and clients are synched correctly.
- Parameters
-
| n | |
| item_state | The item_state (bonux box) that was hit. This is necessary for servers so that the clients can be informed which item was collected. |
◆ rewindTo()
Restore a powerup state.
Called from the kart rewinder when restoring a state.
- Parameters
-
| buffer | Buffer with the state of this powerup object. |
◆ saveState()
Save the powerup state.
Called from the kart rewinder when saving the kart state or when a new powerup even is saved.
- Parameters
-
| buffer | The buffer into which to save the state. |
◆ set()
| void Powerup::set |
( |
PowerupManager::PowerupType |
type, |
|
|
int |
n = 1 |
|
) |
| |
Sets the collected items.
The number of items is increased if the same item is currently collected, otherwise replaces the existing item. It also sets item specific sounds.
- Parameters
-
| type | Thew new type. |
| n | Number of items of the given type. |
◆ setNum()
| void Powerup::setNum |
( |
int |
n = 1 | ) |
|
Sets the amount of the current collected item.
- Parameters
-
The documentation for this class was generated from the following files: