HoverRace  2.0
TrackSelectScene.h
Go to the documentation of this file.
1 
2 // TrackSelectScene.h
3 //
4 // Copyright (c) 2013-2015 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include "../../engine/Display/PickList.h"
25 #include "../../engine/Display/Res.h"
26 #include "../../engine/Model/TrackList.h"
27 #include "GameDirector.h"
28 
29 #include "DialogScene.h"
30 
31 namespace HoverRace {
32  namespace Client {
33  class Rulebook;
34  }
35  namespace Display {
36  class Container;
37  class Display;
38  class FlexGrid;
39  class Label;
40  class Picture;
41  class RuleLine;
42  class Texture;
43  }
44 }
45 
46 namespace HoverRace {
47 namespace Client {
48 
54 {
55  using SUPER = DialogScene;
56 
57 public:
59  std::shared_ptr<const Rulebook> rulebook);
60  virtual ~TrackSelectScene();
61 
62 private:
63  void OnTrackSelected(std::shared_ptr<Model::TrackEntry> entry);
64  void OnTrackChanged();
65  void OnReady();
66 
67 protected:
68  void OnPhaseTransition(double progress) override;
69 
70 public:
71  using okSignal_t = boost::signals2::signal<void(std::shared_ptr<Rules>, std::shared_ptr<Display::Res<Display::Texture>>)>;
72  okSignal_t &GetOkSignal() { return okSignal; }
73 
74  using cancelSignal_t = boost::signals2::signal<void()>;
75  cancelSignal_t &GetCancelSignal() { return cancelSignal; }
76 
77 private:
79  std::shared_ptr<Rules> rules;
80 
82  std::shared_ptr<Model::TrackEntry> selectedTrack;
83 
84  std::shared_ptr<Display::FlexGrid> subtitleGrid;
85  std::shared_ptr<Display::Label> rulebookLbl;
86  std::shared_ptr<Display::Label> rulebookDescLbl;
87  std::shared_ptr<Display::RuleLine> subtitleRule;
88  std::shared_ptr<Display::Container> trackPanel;
89  std::shared_ptr<Display::PickList<
90  std::shared_ptr<Model::TrackEntry>>> trackPick;
91 
92  std::shared_ptr<Display::Container> selTrackPanel;
93  std::shared_ptr<Display::Picture> trackPic;
94  std::shared_ptr<Display::Res<Display::Texture>> mapTexture;
95 
96  std::shared_ptr<Display::FlexGrid> trackMetaGrid;
97  std::shared_ptr<Display::Label> trackNameLbl;
98  std::shared_ptr<Display::Label> trackDescLbl;
99 
100  std::shared_ptr<Display::Button> readyBtn;
101 
104 };
105 
106 } // namespace Client
107 } // namespace HoverRace
std::shared_ptr< Rules > rules
Definition: TrackSelectScene.h:79
Interface for game client shells.
Definition: GameDirector.h:57
std::shared_ptr< Model::TrackEntry > selectedTrack
Definition: TrackSelectScene.h:82
std::shared_ptr< Display::Picture > trackPic
Definition: TrackSelectScene.h:93
std::shared_ptr< Display::Res< Display::Texture > > mapTexture
Definition: TrackSelectScene.h:94
GameDirector & director
Definition: TestLabScene.cpp:160
cancelSignal_t cancelSignal
Definition: TrackSelectScene.h:103
cancelSignal_t & GetCancelSignal()
Definition: TrackSelectScene.h:75
boost::signals2::signal< void(std::shared_ptr< Rules >, std::shared_ptr< Display::Res< Display::Texture >>)> okSignal_t
Definition: TrackSelectScene.h:71
boost::signals2::signal< void()> cancelSignal_t
Definition: TrackSelectScene.h:74
okSignal_t & GetOkSignal()
Definition: TrackSelectScene.h:72
Base class for scenes with a title and status area.
Definition: DialogScene.h:46
Base class for display managers.
Definition: Display.h:73
std::shared_ptr< Display::Button > readyBtn
Definition: TrackSelectScene.h:100
std::shared_ptr< Display::Container > trackPanel
Definition: TrackSelectScene.h:88
Base class for full-scene menus and the like.
Definition: FormScene.h:48
std::shared_ptr< Display::PickList< std::shared_ptr< Model::TrackEntry > > > trackPick
Definition: TrackSelectScene.h:90
okSignal_t okSignal
Definition: TrackSelectScene.h:102
Sorted list of track headers.
Definition: TrackList.h:49
std::shared_ptr< Display::Label > rulebookLbl
Definition: TrackSelectScene.h:85
std::shared_ptr< Display::FlexGrid > trackMetaGrid
Definition: TrackSelectScene.h:96
std::shared_ptr< Display::Label > rulebookDescLbl
Definition: TrackSelectScene.h:86
std::shared_ptr< Display::Label > trackNameLbl
Definition: TrackSelectScene.h:97
Select the track for a new game.
Definition: TrackSelectScene.h:53
Definition: Announcement.h:24
Scrollable list of selectable items.
Definition: PickList.h:191
Model::TrackList trackList
Definition: TrackSelectScene.h:81
std::shared_ptr< Display::Label > trackDescLbl
Definition: TrackSelectScene.h:98
std::shared_ptr< Display::RuleLine > subtitleRule
Definition: TrackSelectScene.h:87
std::shared_ptr< Display::FlexGrid > subtitleGrid
Definition: TrackSelectScene.h:84
std::shared_ptr< Display::Container > selTrackPanel
Definition: TrackSelectScene.h:92
bool trackSelected
Are we exiting because a track was selected?
Definition: TrackSelectScene.h:78