HoverRace  2.0
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
HoverRace::Client::LoadingScene Class Reference

Base class for "Please Wait" loading scenes. More...

#include <LoadingScene.h>

+ Inheritance diagram for HoverRace::Client::LoadingScene:

Public Member Functions

 LoadingScene (Display::Display &display, GameDirector &director, const std::string &name="Loading")
 
virtual ~LoadingScene ()
 
bool IsMouseCursorEnabled () const override
 Determine if the mouse cursor is enabled for this scene. More...
 
void OnPhaseTransition (double progress) override
 Fired during the starting and stopping phases, if SetPhaseTransitionDuration() was set. More...
 
void PrepareRender () override
 
void Render () override
 
std::shared_ptr< Util::LoaderShareLoader () const
 
- Public Member Functions inherited from HoverRace::Client::FormScene
 FormScene (Display::Display &display, const std::string &name="")
 
virtual ~FormScene ()
 
void AttachController (Control::InputEventController &controller, ConnList &conns) override
 Configure the controller mappings. More...
 
- Public Member Functions inherited from HoverRace::Client::UiScene
 UiScene (const std::string &name="")
 
virtual ~UiScene ()
 
void AttachController (Control::InputEventController &controller, ConnList &conns) override
 Configure the controller mappings. More...
 
void DetachController (Control::InputEventController &, ConnList &) override
 Remove the controller mappings. More...
 
bool IsMouseCursorEnabled () const override
 Determine if the mouse cursor is enabled for this scene. More...
 
void PrepareRender () override
 
void Render () override
 
- Public Member Functions inherited from HoverRace::Client::Scene
 Scene (const std::string &name="Unnamed Scene")
 Constructor. More...
 
virtual ~Scene ()
 
void AdvanceScene (Util::OS::timestamp_t tick)
 
void AttachInput (Control::InputEventController &controller)
 Attach the user input to the scene. More...
 
void DetachInput (Control::InputEventController &controller)
 Detach the user input from the scene. More...
 
const std::string & GetName () const
 Retrieve the name of the scene. More...
 
Phase GetPhase () const
 
State GetState () const
 
bool MoveToBackground ()
 Signal that the scene is moving into the background. More...
 
bool MoveToForeground ()
 Signal that the scene is moving into the foreground. More...
 
virtual void OnScenePushed ()
 Called when the scene is actually pushed to the stage. More...
 
Sceneoperator= (const Scene &)=delete
 
virtual std::ostream & OutputDebugText (std::ostream &oss) const
 Output a stream of debug information describing this scene. More...
 
void PrepareScene ()
 
void RenderScene ()
 
bool SetPhase (Phase phase)
 Switch to another phase. More...
 

Protected Member Functions

void OnPhaseChanged (Phase oldPhase) override
 Fired immediately after entering a new phase. More...
 
- Protected Member Functions inherited from HoverRace::Client::FormScene
Display::ContainerGetRoot () const
 
- Protected Member Functions inherited from HoverRace::Client::UiScene
virtual void Layout ()
 Adjust the size and position of any child elements. More...
 
void RequestLayout ()
 Indicate that the current layout is out-of-date and needs to be adjusted. More...
 
void SetFocusRoot (std::shared_ptr< Display::UiViewModel > root)
 Set the widget used as the root for all focus management. More...
 
- Protected Member Functions inherited from HoverRace::Client::Scene
virtual void Advance (Util::OS::timestamp_t tick)
 
Util::OS::timestamp_t GetPhaseDuration (Util::OS::timestamp_t curTime=Util::OS::Time())
 Calculate how much time we've spent in the current phase. More...
 
Util::OS::timestamp_t GetStartingPhaseTime ()
 Return how long the starting phase lasted. More...
 
Util::OS::timestamp_t GetStateDuration (Util::OS::timestamp_t curTime=Util::OS::Time())
 Calculate how much time we've spent in the current state. More...
 
virtual void OnStateChanged (State oldState)
 Fired immediately after entering a new state. More...
 
virtual void OnStateTransition (double progress)
 Fired during the raising and lowering states, if SetStateTransitionDuration() was set. More...
 
void SetPhaseTransitionDuration (Util::OS::timestamp_t ms)
 Set the maximum duration of the starting or stopping phases. More...
 
void SetStateTransitionDuration (Util::OS::timestamp_t ms)
 Set the maximum duration of the raising or lowering state. More...
 

Private Types

using SUPER = FormScene
 

Private Attributes

GameDirectordirector
 
std::unique_ptr< Display::ScreenFadefader
 
std::shared_ptr< Util::Loaderloader
 
bool loading
 

Additional Inherited Members

- Public Types inherited from HoverRace::Client::Scene
enum  Phase {
  Phase::INITIALIZING, Phase::STARTING, Phase::RUNNING, Phase::STOPPING,
  Phase::STOPPED
}
 
enum  State {
  State::INITIALIZING, State::BACKGROUND, State::RAISING, State::FOREGROUND,
  State::LOWERING
}
 
- Protected Attributes inherited from HoverRace::Client::FormScene
Display::Displaydisplay
 
- Protected Attributes inherited from HoverRace::Client::Scene
std::shared_ptr< Util::ProfileradvanceProfiler
 
std::shared_ptr< Util::ProfilerprepareProfiler
 
std::shared_ptr< Util::ProfilerrenderProfiler
 
std::shared_ptr< Util::ProfilerrootProfiler
 

Detailed Description

Base class for "Please Wait" loading scenes.

These scenes provide a way to wait for the previous scene stack to finish unloading resources then allow the new scene to load.

To use this scene, enqueue tasks to the loader, then push the scene that depends on the loader, then push this scene. When all of the resources have been loaded, this scene will automatically pop itself.

Author
Michael Imamura

Member Typedef Documentation

Constructor & Destructor Documentation

HoverRace::Client::LoadingScene::LoadingScene ( Display::Display display,
GameDirector director,
const std::string &  name = "Loading" 
)
HoverRace::Client::LoadingScene::~LoadingScene ( )
virtual

Member Function Documentation

bool HoverRace::Client::LoadingScene::IsMouseCursorEnabled ( ) const
inlineoverridevirtual

Determine if the mouse cursor is enabled for this scene.

Returns
true if the cursor should be shown, false if it should be hidden.

Implements HoverRace::Client::Scene.

void HoverRace::Client::LoadingScene::OnPhaseChanged ( Phase  oldPhase)
overrideprotectedvirtual

Fired immediately after entering a new phase.

Parameters
oldPhaseThe previous phase.
See also
GetPhase()

Reimplemented from HoverRace::Client::Scene.

void HoverRace::Client::LoadingScene::OnPhaseTransition ( double  progress)
overridevirtual

Fired during the starting and stopping phases, if SetPhaseTransitionDuration() was set.

Parameters
progressThe animation progress (during the STARTING phase this goes from 0.0 to 1.0, and in reverse for the STOPPING phase).

Reimplemented from HoverRace::Client::Scene.

Reimplemented in HoverRace::Client::SessionLoadingScene.

void HoverRace::Client::LoadingScene::PrepareRender ( )
overridevirtual

Reimplemented from HoverRace::Client::FormScene.

void HoverRace::Client::LoadingScene::Render ( )
overridevirtual

Reimplemented from HoverRace::Client::FormScene.

std::shared_ptr<Util::Loader> HoverRace::Client::LoadingScene::ShareLoader ( ) const
inline

Member Data Documentation

GameDirector& HoverRace::Client::LoadingScene::director
private
std::unique_ptr<Display::ScreenFade> HoverRace::Client::LoadingScene::fader
private
std::shared_ptr<Util::Loader> HoverRace::Client::LoadingScene::loader
private
bool HoverRace::Client::LoadingScene::loading
private

The documentation for this class was generated from the following files: