18 #ifndef FREE_FOR_ALL_HPP
19 #define FREE_FOR_ALL_HPP
21 #include "modes/world_with_rank.hpp"
22 #include "states_screens/race_gui_base.hpp"
31 bool m_count_down_reached_zero;
33 std::vector<int> m_scores;
39 virtual video::SColor getColor(
unsigned int kart_id)
const;
47 virtual void init() OVERRIDE;
51 virtual void reset(
bool restart=
false) OVERRIDE;
54 std::vector<RaceGUIBase::KartIconDisplayInfo> *info) OVERRIDE;
60 virtual std::pair<int, video::SColor>
63 virtual const std::string&
getIdent() const OVERRIDE;
65 virtual
bool kartHit(
int kart_id,
int hitter = -1) OVERRIDE;
67 virtual
void update(
int ticks) OVERRIDE;
75 int getKartScore(
int kart_id)
const {
return m_scores.at(kart_id); }
77 bool getKartFFAResult(
int kart_id)
const;
82 virtual
void addReservedKart(
int kart_id) OVERRIDE
84 WorldWithRank::addReservedKart(kart_id);
85 m_scores.at(kart_id) = 0;
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
Definition: free_for_all.hpp:29
void handleScoreInServer(int kart_id, int hitter)
Called when the score of kart needs updated.
Definition: free_for_all.cpp:115
virtual bool kartHit(int kart_id, int hitter=-1) OVERRIDE
Called when a kart is hit.
Definition: free_for_all.cpp:97
virtual void update(int ticks) OVERRIDE
Updates the physics, all karts, the track, and projectile manager.
Definition: free_for_all.cpp:154
virtual void reset(bool restart=false) OVERRIDE
Called when a battle is restarted.
Definition: free_for_all.cpp:64
virtual const std::string & getIdent() const OVERRIDE
Returns the internal identifier for this race.
Definition: free_for_all.cpp:148
virtual bool raceHasLaps() OVERRIDE
Called when it is needed to know whether this kind of race involves counting laps.
Definition: free_for_all.hpp:56
virtual void getKartsDisplayInfo(std::vector< RaceGUIBase::KartIconDisplayInfo > *info) OVERRIDE
Returns the data to display in the race gui.
Definition: free_for_all.cpp:203
virtual bool isRaceOver() OVERRIDE
The battle is over if only one kart is left, or no player kart.
Definition: free_for_all.cpp:184
virtual void terminateRace() OVERRIDE
Called at the end of a race.
Definition: free_for_all.cpp:270
virtual void countdownReachedZero() OVERRIDE
Called when the match time ends.
Definition: free_for_all.cpp:84
virtual void init() OVERRIDE
call just after instanciating.
Definition: free_for_all.cpp:53
virtual std::pair< int, video::SColor > getSpeedometerDigit(const AbstractKart *kart) const OVERRIDE
Definition: free_for_all.cpp:230
FreeForAll()
Constructor.
Definition: free_for_all.cpp:34
virtual bool shouldDrawSpeedometerDigit() const OVERRIDE
Definition: free_for_all.hpp:58
virtual std::pair< uint32_t, uint32_t > getGameStartedProgress() const OVERRIDE
Used by server to get the current started game progress in either or both remaining time or progress ...
Definition: free_for_all.cpp:312
A new implementation of NetworkString, which has a fixed format: Byte 0: The type of the message,...
Definition: network_string.hpp:422
Represents a peer. This class is used to interface the ENetPeer structure.
Definition: stk_peer.hpp:76
A WorldWithRank is a world where the karts are ranked.
Definition: world_with_rank.hpp:39