SuperTuxKart
Public Member Functions | Private Attributes | List of all members
CheckManager Class Reference

Controls all checks structures of a track. More...

#include <check_manager.hpp>

Inheritance diagram for CheckManager:
Inheritance graph
[legend]

Public Member Functions

 ~CheckManager ()
 Private destructor (to make sure it is only called using the static destroy function). More...
 
void add (CheckStructure *strct)
 
void addFlyableToCannons (Flyable *flyable)
 Adds a flyable object to be tested against cannons. More...
 
void removeFlyableFromCannons (Flyable *flyable)
 Removes a flyable from all cannons. More...
 
void load (const XMLNode &node)
 Loads all check structure informaiton from the specified xml file.
 
void update (float dt)
 Updates all animations. More...
 
void reset (const Track &track)
 Resets all checks. More...
 
void resetAfterKartMove (AbstractKart *kart)
 Called after a kart is moved (e.g. More...
 
void resetAfterRewind ()
 
unsigned int getLapLineIndex () const
 Returns the index of the first check structures that triggers a new lap to be counted. More...
 
int getChecklineTriggering (const Vec3 &from, const Vec3 &to) const
 Returns the check line index that is triggered when going from 'from' to 'to'. More...
 
unsigned int getCheckStructureCount () const
 Returns the number of check structures defined. More...
 
CheckStructuregetCheckStructure (unsigned int n) const
 Returns the nth. More...
 

Private Attributes

std::vector< CheckStructure * > m_all_checks
 

Detailed Description

Controls all checks structures of a track.

Constructor & Destructor Documentation

◆ ~CheckManager()

CheckManager::~CheckManager ( )

Private destructor (to make sure it is only called using the static destroy function).

Frees all check structures.

Member Function Documentation

◆ addFlyableToCannons()

void CheckManager::addFlyableToCannons ( Flyable flyable)

Adds a flyable object to be tested against cannons.

This will allow bowling- and rubber-balls to fly in a cannon.

Parameters
flyablePointer to the flyable to be added.

◆ getChecklineTriggering()

int CheckManager::getChecklineTriggering ( const Vec3 from,
const Vec3 to 
) const

Returns the check line index that is triggered when going from 'from' to 'to'.

If no check line is triggered, -1 will be returned.

Parameters
fromCoordinates to start from.
toCoordinates to go to.

◆ getCheckStructure()

CheckStructure* CheckManager::getCheckStructure ( unsigned int  n) const
inline

Returns the nth.

check structure.

◆ getCheckStructureCount()

unsigned int CheckManager::getCheckStructureCount ( ) const
inline

Returns the number of check structures defined.

◆ getLapLineIndex()

unsigned int CheckManager::getLapLineIndex ( ) const

Returns the index of the first check structures that triggers a new lap to be counted.

It aborts if no lap structure is defined.

◆ removeFlyableFromCannons()

void CheckManager::removeFlyableFromCannons ( Flyable flyable)

Removes a flyable from all cannons.

Used when this flyable is removed (e.g. explodes).

Parameters
flyablePointer to the flyable to be removed.

◆ reset()

void CheckManager::reset ( const Track track)

Resets all checks.

◆ resetAfterKartMove()

void CheckManager::resetAfterKartMove ( AbstractKart kart)

Called after a kart is moved (e.g.

after a rescue) to reset any cached check information. Without this an incorrect crossing of a checkline could be triggered since a CheckLine stores the previous position).

Parameters
kart_indexIndex of the kart that was moved.

◆ update()

void CheckManager::update ( float  dt)

Updates all animations.

Called one per time step.

Parameters
dtTime since last call.

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