SuperTuxKart
grand_prix_win.hpp
1 //
2 // SuperTuxKart - a fun racing game with go-kart
3 // Copyright (C) 2010-2015 SuperTuxKart-Team
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 3
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 #ifndef HEADER_GRAND_PRIX_WIN_HPP
20 #define HEADER_GRAND_PRIX_WIN_HPP
21 
22 #include "audio/sfx_base.hpp"
23 #include "guiengine/screen.hpp"
24 #include "karts/kart_model.hpp"
25 #include "states_screens/grand_prix_cutscene.hpp"
26 #include <utility>
27 
28 namespace irr { namespace scene { class ISceneNode; class ICameraSceneNode; class ILightSceneNode; class IMeshSceneNode; } }
29 namespace GUIEngine { class LabelWidget; }
30 class KartProperties;
31 class TrackObject;
32 
37 class GrandPrixWin :
38  public GrandPrixCutscene,
39  public GUIEngine::ScreenSingleton<GrandPrixWin>
40 {
42 
43  GrandPrixWin();
44 
45  virtual ~GrandPrixWin() {};
46 
48  double m_global_time;
49 
50  TrackObject* m_podium_steps[3];
51 
52  TrackObject* m_kart_node[3];
53 
55  std::vector<KartModel*> m_all_kart_models;
56 
57  GUIEngine::LabelWidget* m_unlocked_label;
58 
59  int m_phase;
60 
63 
64  float m_kart_x[3], m_kart_y[3], m_kart_z[3];
65  float m_kart_rotation[3];
66 
67  float m_podium_x[3], m_podium_y[3], m_podium_z[3];
68 
71 
72 public:
73  // implement callbacks from parent class GUIEngine::Screen
74  void init() OVERRIDE;
75  void loadedFromFile() OVERRIDE {};
76  void onCutsceneEnd() OVERRIDE;
77  void onUpdate(float dt) OVERRIDE;
78  MusicInformation* getInGameMenuMusic() const OVERRIDE;
79 
81  void setNumGPKarts(int num_gp_karts);
82  void setKarts(const std::pair<std::string, float> karts[3]);
83  void setPlayerWon(bool some_player_won) { m_player_won = some_player_won; }
84 };
85 
86 #endif
87 
A simple label widget.
Definition: label_widget.hpp:41
Declares a class to be a singleton.
Definition: screen.hpp:59
Definition: grand_prix_cutscene.hpp:28
Screen shown at the end of a Grand Prix.
Definition: grand_prix_win.hpp:40
double m_global_time
Global evolution of time.
Definition: grand_prix_win.hpp:45
void setNumGPKarts(int num_gp_karts)
Definition: grand_prix_win.cpp:335
int m_num_gp_karts
Used to pick the happy/sad animations of karts.
Definition: grand_prix_win.hpp:62
void onUpdate(float dt) OVERRIDE
optional callback you can override to be notified at every frame.
Definition: grand_prix_win.cpp:225
void loadedFromFile() OVERRIDE
Callback invoked when loading this menu.
Definition: grand_prix_win.hpp:75
MusicInformation * getInGameMenuMusic() const OVERRIDE
Definition: grand_prix_win.cpp:459
bool m_player_won
Used to display a different message if a player is 1st.
Definition: grand_prix_win.hpp:70
std::vector< KartModel * > m_all_kart_models
A copy of the kart model for each kart used.
Definition: grand_prix_win.hpp:55
void init() OVERRIDE
Callback invoked when entering this menu (after the widgets have been added).
Definition: grand_prix_win.cpp:151
This class stores the properties of a kart.
Definition: kart_properties.hpp:60
Wrapper around an instance of the Music interface Adds information like composer, song title,...
Definition: music_information.hpp:43
This is a base object for any separate object on the track, which might also have a skeletal animatio...
Definition: track_object.hpp:56
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33