SuperTuxKart
Loading...
Searching...
No Matches
overworld.hpp
1// SuperTuxKart - a fun racing game with go-kart
2// Copyright (C) 2004-2015 SuperTuxKart-Team
3//
4// This program is free software; you can redistribute it and/or
5// modify it under the terms of the GNU General Public License
6// as published by the Free Software Foundation; either version 3
7// of the License, or (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18#ifndef HEADER_OVERWORLD_HPP
19#define HEADER_OVERWORLD_HPP
20
21#include <vector>
22
23#include "modes/world.hpp"
24#include "utils/aligned_array.hpp"
25
26#include "LinearMath/btTransform.h"
27
28/*
29 * The overworld map where challenges are played.
30 * \note Extends world to make a simple world where karts can drive around,
31 * it adds challenges and starting of races.
32 * \ingroup modes
33 */
34class OverWorld : public World
35{
36protected:
37
39 virtual void createRaceGUI() OVERRIDE;
40
41 bool m_return_to_garage;
42
43public:
44 OverWorld();
45 virtual ~OverWorld();
46
47 static void enterOverWorld();
48
49 virtual void update(int ticks) OVERRIDE;
50 unsigned int getRescuePositionIndex(AbstractKart *kart) OVERRIDE;
51 virtual void getKartsDisplayInfo(
52 std::vector<RaceGUIBase::KartIconDisplayInfo> *info) OVERRIDE;
53 // ------------------------------------------------------------------------
55 virtual bool raceHasLaps() OVERRIDE { return false; }
56 // ------------------------------------------------------------------------
58 virtual bool isRaceOver() OVERRIDE { return false; }
59 // ------------------------------------------------------------------------
61 virtual const std::string&
62 getIdent() const OVERRIDE { return IDENT_OVERWORLD; }
63 // ------------------------------------------------------------------------
65 virtual bool shouldDrawTimer() const OVERRIDE { return false; }
66 // ------------------------------------------------------------------------
68 virtual void onFirePressed(Controller* who) OVERRIDE;
69 // ------------------------------------------------------------------------
71 virtual bool useChecklineRequirements() const OVERRIDE { return false; }
72 // ------------------------------------------------------------------------
73 void scheduleSelectKart() { m_return_to_garage = true; }
74 // ------------------------------------------------------------------------
75 virtual void onMouseClick(int x, int y) OVERRIDE;
76};
77
78#endif
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
This is the base class for kart controller - that can be a player or a a robot.
Definition: controller.hpp:46
Definition: overworld.hpp:35
virtual void onMouseClick(int x, int y) OVERRIDE
Called when a mouse click happens.
Definition: overworld.cpp:288
static void enterOverWorld()
Function to simplify the start process.
Definition: overworld.cpp:58
virtual void getKartsDisplayInfo(std::vector< RaceGUIBase::KartIconDisplayInfo > *info) OVERRIDE
This function is not used in the overworld race gui.
Definition: overworld.cpp:210
virtual void createRaceGUI() OVERRIDE
Override from base class.
Definition: overworld.cpp:218
virtual void update(int ticks) OVERRIDE
General update function called once per frame.
Definition: overworld.cpp:117
virtual bool isRaceOver() OVERRIDE
The overworld is not a race per se so it's never over.
Definition: overworld.hpp:58
virtual void onFirePressed(Controller *who) OVERRIDE
Override base class method.
Definition: overworld.cpp:225
virtual const std::string & getIdent() const OVERRIDE
Implement base class method.
Definition: overworld.hpp:62
virtual bool useChecklineRequirements() const OVERRIDE
Override settings from base class.
Definition: overworld.hpp:71
virtual bool raceHasLaps() OVERRIDE
Returns if this race mode has laps.
Definition: overworld.hpp:55
virtual bool shouldDrawTimer() const OVERRIDE
Override base class method.
Definition: overworld.hpp:65
unsigned int getRescuePositionIndex(AbstractKart *kart) OVERRIDE
Finds the starting position which is closest to the kart.
Definition: overworld.cpp:180
base class for all game modes This class is responsible for running the actual race.
Definition: world.hpp:88