SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ProjectileManager Class Reference
Inheritance diagram for ProjectileManager:
Inheritance graph
[legend]

Public Member Functions

void loadData ()
 
void cleanup ()
 
void update (int ticks)
 General projectile update call.
 
void updateGraphics (float dt)
 Called once per rendered frame.
 
void removeTextures ()
 
bool projectileIsClose (const AbstractKart *const kart, float radius)
 Returns true if a projectile is within the given distance of the specified kart.
 
int getNearbyProjectileCount (const AbstractKart *const kart, float radius, PowerupManager::PowerupType type, bool exclude_owned=false)
 Returns an int containing the numbers of a given flyable in a given radius around the kart.
 
void addHitEffect (HitEffect *hit_effect)
 Adds a special hit effect to be shown.
 
std::shared_ptr< RewinderaddRewinderFromNetworkState (const std::string &uid)
 
std::shared_ptr< FlyablenewProjectile (AbstractKart *kart, PowerupManager::PowerupType type)
 Creates a new projectile of the given type.
 
std::vector< Vec3getBasketballPositions ()
 
void addByUID (const std::string &uid, std::shared_ptr< Flyable > f)
 
void removeByUID (const std::string &uid)
 

Static Public Member Functions

static ProjectileManagerget ()
 
static void create ()
 
static void destroy ()
 
static void clear ()
 

Private Types

typedef std::vector< HitEffect * > HitEffects
 

Private Member Functions

std::string getUniqueIdentity (AbstractKart *kart, PowerupManager::PowerupType type)
 
void updateServer (int ticks)
 Updates all rockets on the server (or no networking).
 

Private Attributes

std::map< std::string, std::shared_ptr< Flyable > > m_active_projectiles
 The list of all active projectiles, i.e.
 
HitEffects m_active_hit_effects
 All active hit effects, i.e.
 

Member Function Documentation

◆ addHitEffect()

void ProjectileManager::addHitEffect ( HitEffect hit_effect)
inline

Adds a special hit effect to be shown.

Parameters
hit_effectThe hit effect to be added.

◆ getNearbyProjectileCount()

int ProjectileManager::getNearbyProjectileCount ( const AbstractKart *const  kart,
float  radius,
PowerupManager::PowerupType  type,
bool  exclude_owned = false 
)

Returns an int containing the numbers of a given flyable in a given radius around the kart.

Parameters
kartThe kart for which the test is done.
radiusDistance within which the projectile must be.
typeThe type of projectile checked

◆ newProjectile()

std::shared_ptr< Flyable > ProjectileManager::newProjectile ( AbstractKart kart,
PowerupManager::PowerupType  type 
)

Creates a new projectile of the given type.

Parameters
kartThe kart which shoots the projectile.
typeType of projectile.

◆ projectileIsClose()

bool ProjectileManager::projectileIsClose ( const AbstractKart *const  kart,
float  radius 
)

Returns true if a projectile is within the given distance of the specified kart.

Parameters
kartThe kart for which the test is done.
radiusDistance within which the projectile must be.

◆ updateGraphics()

void ProjectileManager::updateGraphics ( float  dt)

Called once per rendered frame.

It is used to only update any graphical effects, and calls updateGraphics in any flyable objects.

Parameters
dtTime step size (since last call).

Member Data Documentation

◆ m_active_hit_effects

HitEffects ProjectileManager::m_active_hit_effects
private

All active hit effects, i.e.

hit effects which are currently being shown or have a sfx playing.

◆ m_active_projectiles

std::map<std::string, std::shared_ptr<Flyable> > ProjectileManager::m_active_projectiles
private

The list of all active projectiles, i.e.

projectiles which are currently moving on the track.


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