18#ifndef HEADER_WORLD_WITH_RANK_HPP
19#define HEADER_WORLD_WITH_RANK_HPP
23#include "modes/world.hpp"
54 std::vector<bool> m_position_used;
59 bool m_position_setting_initialised;
76 virtual void init() OVERRIDE;
77 virtual
void reset(
bool restart=false) OVERRIDE;
83 unsigned int position);
101 bool isOnRoad(
unsigned int kart_index)
const;
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
This object keeps track of which sector an object is on.
Definition: track_sector.hpp:39
A WorldWithRank is a world where the karts are ranked.
Definition: world_with_rank.hpp:39
virtual unsigned int getRescuePositionIndex(AbstractKart *kart) OVERRIDE
Determines the rescue position for a kart.
Definition: world_with_rank.cpp:169
void beginSetKartPositions()
This function must be called before starting to set all kart positions again.
Definition: world_with_rank.cpp:93
void endSetKartPositions()
Called once the last position was set.
Definition: world_with_rank.cpp:151
virtual void init() OVERRIDE
call just after instanciating.
Definition: world_with_rank.cpp:42
std::vector< int > m_position_index
This contains a mapping from race position to kart index.
Definition: world_with_rank.hpp:42
bool isOnRoad(unsigned int kart_index) const
Returns true if the kart is on a valid graph quad.
Definition: world_with_rank.cpp:225
void updateSectorForKarts()
Localize each kart on the graph using its center xyz.
Definition: world_with_rank.cpp:249
bool setKartPosition(unsigned int kart_id, unsigned int position)
Sets the position of a kart.
Definition: world_with_rank.cpp:114
virtual AbstractKart * getKartAtDrawingPosition(unsigned int p) const
Returns the kart at which position (start from 1) to draw race icon.
Definition: world_with_rank.hpp:88
bool m_display_rank
Whether to display the rank in the race GUI.
Definition: world_with_rank.hpp:45
virtual int getScoreForPosition(int p)
Returns the number of points for a kart at a specified position.
Definition: world_with_rank.cpp:214
std::vector< TrackSector * > m_kart_track_sector
Stores the current graph node and track coordinates for each kart.
Definition: world_with_rank.hpp:65
virtual void reset(bool restart=false) OVERRIDE
This function is called before a race is started (i.e.
Definition: world_with_rank.cpp:66
std::vector< int > m_score_for_position
The points given to a kart on a given position (index is 0 based, so using race-position - 1.
Definition: world_with_rank.hpp:49
int getSectorForKart(const AbstractKart *kart) const
Gets the sector a kart is on.
Definition: world_with_rank.cpp:239
TrackSector * getTrackSector(unsigned int kart_index) const
Returns the track_sector object for the specified kart.
Definition: world_with_rank.hpp:95
AbstractKart * getKartAtPosition(unsigned int p) const
Returns the kart with a given position.
Definition: world_with_rank.cpp:80
base class for all game modes This class is responsible for running the actual race.
Definition: world.hpp:88