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  */
34 class OverWorld : public World
35 {
36 protected:
37 
38     /** Override from base class */
39     virtual void  createRaceGUI() OVERRIDE;
40 
41     bool m_return_to_garage;
42 
43 public:
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     // ------------------------------------------------------------------------
54     /** Returns if this race mode has laps. */
raceHasLaps()55     virtual bool  raceHasLaps() OVERRIDE { return false; }
56     // ------------------------------------------------------------------------
57     /** The overworld is not a race per se so it's never over */
isRaceOver()58     virtual bool    isRaceOver() OVERRIDE { return false; }
59     // ------------------------------------------------------------------------
60     /** Implement base class method */
61     virtual const std::string&
getIdent() const62                     getIdent() const OVERRIDE { return IDENT_OVERWORLD; }
63     // ------------------------------------------------------------------------
64     /** Override base class method */
shouldDrawTimer() const65     virtual bool shouldDrawTimer() const OVERRIDE { return false; }
66     // ------------------------------------------------------------------------
67     /** Override base class method */
68     virtual void onFirePressed(Controller* who) OVERRIDE;
69     // ------------------------------------------------------------------------
70     /** Override settings from base class */
useChecklineRequirements() const71     virtual bool useChecklineRequirements() const OVERRIDE { return false; }
72     // ------------------------------------------------------------------------
scheduleSelectKart()73     void scheduleSelectKart() { m_return_to_garage = true; }
74     // ------------------------------------------------------------------------
75     virtual void onMouseClick(int x, int y) OVERRIDE;
76 };
77 
78 #endif
79