19#ifndef HEADER_POWERUP_HPP
20#define HEADER_POWERUP_HPP
24#include "items/powerup_manager.hpp"
25#include "utils/no_copy.hpp"
52 std::set<int> m_played_sound_ticks;
57 void set (PowerupManager::PowerupType _type,
int n = 1);
66 void update(
int ticks);
72 PowerupManager::PowerupType
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53
Contains the state information of an item, i.e.
Definition: item.hpp:53
Definition: material.hpp:48
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:26
Definition: powerup.hpp:38
AbstractKart * m_kart
The owner (kart) of this powerup.
Definition: powerup.hpp:50
void set(PowerupManager::PowerupType _type, int n=1)
Sets the collected items.
Definition: powerup.cpp:136
~Powerup()
Frees the memory for the sound effects.
Definition: powerup.cpp:55
void reset()
Resets the powerup, called at begin of a race.
Definition: powerup.cpp:63
int getNum() const
Returns the number of powerups.
Definition: powerup.hpp:69
void rewindTo(BareNetworkString *buffer)
Restore a powerup state.
Definition: powerup.cpp:92
void setNum(int n=1)
Sets the amount of the current collected item.
Definition: powerup.cpp:205
PowerupManager::PowerupType m_type
The powerup type.
Definition: powerup.hpp:44
Material * getIcon() const
Returns the icon for the currently collected powerup.
Definition: powerup.cpp:217
SFXBase * m_sound_use
Sound effect that is being played.
Definition: powerup.hpp:41
void use()
Use (fire) this powerup.
Definition: powerup.cpp:251
void saveState(BareNetworkString *buffer) const
Save the powerup state.
Definition: powerup.cpp:81
PowerupManager::PowerupType getType() const
Returns the type of this powerup.
Definition: powerup.hpp:73
void hitBonusBox(const ItemState &item)
This function is called when a bnous box is it.
Definition: powerup.cpp:512
void adjustSound()
Does the sound configuration.
Definition: powerup.cpp:227
int m_number
Number of collected powerups.
Definition: powerup.hpp:47
The base class for sound effects.
Definition: sfx_base.hpp:43