SuperTuxKart
Loading...
Searching...
No Matches
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).
 
void add (CheckStructure *strct)
 
void addFlyableToCannons (Flyable *flyable)
 Adds a flyable object to be tested against cannons.
 
void removeFlyableFromCannons (Flyable *flyable)
 Removes a flyable from all cannons.
 
void load (const XMLNode &node)
 Loads all check structure informaiton from the specified xml file.
 
void update (float dt)
 Updates all animations.
 
void reset (const Track &track)
 Resets all checks.
 
void resetAfterKartMove (AbstractKart *kart)
 Called after a kart is moved (e.g.
 
void resetAfterRewind ()
 
unsigned int getLapLineIndex () const
 Returns the index of the first check structures that triggers a new lap to be counted.
 
int getChecklineTriggering (const Vec3 &from, const Vec3 &to) const
 Returns the check line index that is triggered when going from 'from' to 'to'.
 
unsigned int getCheckStructureCount () const
 Returns the number of check structures defined.
 
CheckStructuregetCheckStructure (unsigned int n) const
 Returns the nth.
 

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.

◆ 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.

◆ 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: