HoverRace  2.0
GameSelectScene.h
Go to the documentation of this file.
1 
2 // GameSelectScene.h
3 //
4 // Copyright (c) 2013-2016 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/Model/TrackList.h"
25 #include "GameDirector.h"
26 
27 #include "DialogScene.h"
28 
29 namespace HoverRace {
30  namespace Client {
31  class Rulebook;
32  class RulebookLibrary;
33  }
34  namespace Display {
35  class Container;
36  class Display;
37  }
38 }
39 
40 namespace HoverRace {
41 namespace Client {
42 
52 {
53  using SUPER = DialogScene;
54 
55 public:
57  RulebookLibrary &rulebookLibrary, bool multiplayer);
58  virtual ~GameSelectScene();
59 
60 private:
61  void OnRulebookSelected(std::shared_ptr<const Rulebook> rulebook);
62 
63 protected:
64  void OnOk() override;
65  void OnCancel() override;
66 
67 protected:
68  void OnPhaseTransition(double progress) override;
69  void OnStateTransition(double progress) override;
70 
71 public:
72  using okSignal_t = boost::signals2::signal<void(std::shared_ptr<Rules>, std::shared_ptr<Display::Res<Display::Texture>>)>;
73  okSignal_t &GetOkSignal() { return okSignal; }
74 
75  using cancelSignal_t = boost::signals2::signal<void()>;
76  cancelSignal_t &GetCancelSignal() { return cancelSignal; }
77 
78 public:
79  void Render() override;
80 
81 private:
85 
86  std::shared_ptr<Display::Container> rulebookPanel;
87  std::vector<std::shared_ptr<Display::Button>> modeBtns;
88 
91 };
92 
93 } // namespace Client
94 } // namespace HoverRace
cancelSignal_t & GetCancelSignal()
Definition: GameSelectScene.h:76
Interface for game client shells.
Definition: GameDirector.h:57
cancelSignal_t cancelSignal
Definition: GameSelectScene.h:90
boost::signals2::signal< void()> cancelSignal_t
Definition: GameSelectScene.h:75
GameDirector & director
Definition: GameSelectScene.h:83
std::shared_ptr< Display::Container > rulebookPanel
Definition: GameSelectScene.h:86
GameDirector & director
Definition: TestLabScene.cpp:160
okSignal_t okSignal
Definition: GameSelectScene.h:89
okSignal_t & GetOkSignal()
Definition: GameSelectScene.h:73
Base class for scenes with a title and status area.
Definition: DialogScene.h:46
Base class for display managers.
Definition: Display.h:73
boost::signals2::signal< void(std::shared_ptr< Rules >, std::shared_ptr< Display::Res< Display::Texture >>)> okSignal_t
Definition: GameSelectScene.h:72
Base class for full-scene menus and the like.
Definition: FormScene.h:48
Display::Display & display
Definition: GameSelectScene.h:82
std::vector< std::shared_ptr< Display::Button > > modeBtns
Definition: GameSelectScene.h:87
The collection of all registered rulebooks.
Definition: RulebookLibrary.h:40
Definition: Announcement.h:24
bool trackSelected
Are we exiting because a track was selected?
Definition: GameSelectScene.h:84
Select options for a new game (track, rules, etc.).
Definition: GameSelectScene.h:51