HoverRace  2.0
LoadingScene.h
Go to the documentation of this file.
1 
2 // LoadingScene.h
3 //
4 // Copyright (c) 2014, 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 "GameDirector.h"
25 
26 #include "FormScene.h"
27 
28 namespace HoverRace {
29  namespace Display {
30  class ScreenFade;
31  }
32  namespace Util {
33  class Loader;
34  }
35 }
36 
37 namespace HoverRace {
38 namespace Client {
39 
52 class LoadingScene : public FormScene
53 {
54  using SUPER = FormScene;
55 
56 public:
58  const std::string &name = "Loading");
59  virtual ~LoadingScene();
60 
61 public:
62  std::shared_ptr<Util::Loader> ShareLoader() const { return loader; }
63 
64 public:
65  bool IsMouseCursorEnabled() const override { return false; }
66 
67 protected:
68  void OnPhaseChanged(Phase oldPhase) override;
69 
70 public:
71  void OnPhaseTransition(double progress) override;
72  void PrepareRender() override;
73  void Render() override;
74 
75 private:
77  bool loading;
78  std::shared_ptr<Util::Loader> loader;
79  std::unique_ptr<Display::ScreenFade> fader;
80 };
81 
82 } // namespace Client
83 } // namespace HoverRace
Interface for game client shells.
Definition: GameDirector.h:57
Base class for UI-centric scenes.
Definition: UiScene.h:42
std::shared_ptr< Util::Loader > ShareLoader() const
Definition: LoadingScene.h:62
bool loading
Definition: LoadingScene.h:77
std::shared_ptr< Util::Loader > loader
Definition: LoadingScene.h:78
GameDirector & director
Definition: TestLabScene.cpp:160
bool IsMouseCursorEnabled() const override
Determine if the mouse cursor is enabled for this scene.
Definition: LoadingScene.h:65
Base class for display managers.
Definition: Display.h:73
Base class for full-scene menus and the like.
Definition: FormScene.h:48
std::unique_ptr< Display::ScreenFade > fader
Definition: LoadingScene.h:79
GameDirector & director
Definition: LoadingScene.h:76
Phase
Definition: Scene.h:46
Definition: Announcement.h:24
Base class for "Please Wait" loading scenes.
Definition: LoadingScene.h:52