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

Select the track for a new game. More...

#include <TrackSelectScene.h>

+ Inheritance diagram for HoverRace::Client::TrackSelectScene:

Public Types

using cancelSignal_t = boost::signals2::signal< void()>
 
using okSignal_t = boost::signals2::signal< void(std::shared_ptr< Rules >, std::shared_ptr< Display::Res< Display::Texture >>)>
 
- 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
}
 

Public Member Functions

 TrackSelectScene (Display::Display &display, GameDirector &director, std::shared_ptr< const Rulebook > rulebook)
 
virtual ~TrackSelectScene ()
 
cancelSignal_tGetCancelSignal ()
 
okSignal_tGetOkSignal ()
 
- Public Member Functions inherited from HoverRace::Client::DialogScene
 DialogScene (Display::Display &display, GameDirector &director, const std::string &parentTitle, const std::string &title, const std::string &name)
 Constructor. More...
 
 DialogScene (Display::Display &display, GameDirector &director, const std::string &title="", const std::string &name="")
 
virtual ~DialogScene ()
 
void AttachController (Control::InputEventController &controller, ConnList &conns) override
 Configure the controller mappings. More...
 
void DetachController (Control::InputEventController &controller, ConnList &conns) override
 Remove the controller mappings. More...
 
void PrepareRender () override
 
void Render () override
 
- 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...
 
void PrepareRender () override
 
void Render () override
 
- 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 OnPhaseTransition (double progress) override
 Fired during the starting and stopping phases, if SetPhaseTransitionDuration() was set. More...
 
- Protected Member Functions inherited from HoverRace::Client::DialogScene
Display::ContainerGetContentRoot () const
 
const std::string & GetFullTitle () const
 Retrieve the full combined title (including parent title). More...
 
Display::ContainerGetStatusRoot () const
 
const std::string & GetTitle () const
 
virtual void OnCancel ()
 Called when the "Cancel" action is fired. More...
 
virtual void OnExtra ()
 Called when the scene-specific extra action is fired. More...
 
virtual void OnOk ()
 Called when the "OK" action is fired. More...
 
void SetBackground (Display::Background *fader)
 Set the background, replacing the currently set background. More...
 
void SetStoppingTransitionEnabled (bool enabled)
 Enable or disable content visibility while scene is stopping. More...
 
void SupportCancelAction (const std::string &label="")
 Enable the "Cancel" action for this scene. More...
 
void SupportExtraAction (const std::string &label)
 Enable the "extra" action for this scene. More...
 
void SupportOkAction (const std::string &label="")
 Enable the "OK" action for this scene. 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 OnPhaseChanged (Phase oldPhase)
 Fired immediately after entering a new phase. 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 = DialogScene
 

Private Member Functions

void OnReady ()
 
void OnTrackChanged ()
 
void OnTrackSelected (std::shared_ptr< Model::TrackEntry > entry)
 

Private Attributes

cancelSignal_t cancelSignal
 
std::shared_ptr< Display::Res< Display::Texture > > mapTexture
 
okSignal_t okSignal
 
std::shared_ptr< Display::ButtonreadyBtn
 
std::shared_ptr< Display::LabelrulebookDescLbl
 
std::shared_ptr< Display::LabelrulebookLbl
 
std::shared_ptr< Rulesrules
 
std::shared_ptr< Model::TrackEntryselectedTrack
 
std::shared_ptr< Display::ContainerselTrackPanel
 
std::shared_ptr< Display::FlexGridsubtitleGrid
 
std::shared_ptr< Display::RuleLinesubtitleRule
 
std::shared_ptr< Display::LabeltrackDescLbl
 
Model::TrackList trackList
 
std::shared_ptr< Display::FlexGridtrackMetaGrid
 
std::shared_ptr< Display::LabeltrackNameLbl
 
std::shared_ptr< Display::ContainertrackPanel
 
std::shared_ptr< Display::PicturetrackPic
 
std::shared_ptr< Display::PickList< std::shared_ptr< Model::TrackEntry > > > trackPick
 
bool trackSelected
 Are we exiting because a track was selected? More...
 

Additional Inherited Members

- Static Public Attributes inherited from HoverRace::Client::DialogScene
static constexpr double MARGIN_WIDTH = 40
 
- Static Protected Member Functions inherited from HoverRace::Client::DialogScene
static std::string JoinTitles (const std::string &parent, const std::string &title)
 Combine a parent dialog title to the child dialog title. More...
 
- Protected Attributes inherited from HoverRace::Client::DialogScene
GameDirectordirector
 
- 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

Select the track for a new game.

Author
Michael Imamura

Member Typedef Documentation

using HoverRace::Client::TrackSelectScene::cancelSignal_t = boost::signals2::signal<void()>
using HoverRace::Client::TrackSelectScene::okSignal_t = boost::signals2::signal<void(std::shared_ptr<Rules>, std::shared_ptr<Display::Res<Display::Texture>>)>

Constructor & Destructor Documentation

HoverRace::Client::TrackSelectScene::TrackSelectScene ( Display::Display display,
GameDirector director,
std::shared_ptr< const Rulebook rulebook 
)
HoverRace::Client::TrackSelectScene::~TrackSelectScene ( )
virtual

Member Function Documentation

cancelSignal_t& HoverRace::Client::TrackSelectScene::GetCancelSignal ( )
inline
okSignal_t& HoverRace::Client::TrackSelectScene::GetOkSignal ( )
inline
void HoverRace::Client::TrackSelectScene::OnPhaseTransition ( double  progress)
overrideprotectedvirtual

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::DialogScene.

void HoverRace::Client::TrackSelectScene::OnReady ( )
private
void HoverRace::Client::TrackSelectScene::OnTrackChanged ( )
private
void HoverRace::Client::TrackSelectScene::OnTrackSelected ( std::shared_ptr< Model::TrackEntry entry)
private

Member Data Documentation

cancelSignal_t HoverRace::Client::TrackSelectScene::cancelSignal
private
std::shared_ptr<Display::Res<Display::Texture> > HoverRace::Client::TrackSelectScene::mapTexture
private
okSignal_t HoverRace::Client::TrackSelectScene::okSignal
private
std::shared_ptr<Display::Button> HoverRace::Client::TrackSelectScene::readyBtn
private
std::shared_ptr<Display::Label> HoverRace::Client::TrackSelectScene::rulebookDescLbl
private
std::shared_ptr<Display::Label> HoverRace::Client::TrackSelectScene::rulebookLbl
private
std::shared_ptr<Rules> HoverRace::Client::TrackSelectScene::rules
private
std::shared_ptr<Model::TrackEntry> HoverRace::Client::TrackSelectScene::selectedTrack
private
std::shared_ptr<Display::Container> HoverRace::Client::TrackSelectScene::selTrackPanel
private
std::shared_ptr<Display::FlexGrid> HoverRace::Client::TrackSelectScene::subtitleGrid
private
std::shared_ptr<Display::RuleLine> HoverRace::Client::TrackSelectScene::subtitleRule
private
std::shared_ptr<Display::Label> HoverRace::Client::TrackSelectScene::trackDescLbl
private
Model::TrackList HoverRace::Client::TrackSelectScene::trackList
private
std::shared_ptr<Display::FlexGrid> HoverRace::Client::TrackSelectScene::trackMetaGrid
private
std::shared_ptr<Display::Label> HoverRace::Client::TrackSelectScene::trackNameLbl
private
std::shared_ptr<Display::Container> HoverRace::Client::TrackSelectScene::trackPanel
private
std::shared_ptr<Display::Picture> HoverRace::Client::TrackSelectScene::trackPic
private
std::shared_ptr<Display::PickList< std::shared_ptr<Model::TrackEntry> > > HoverRace::Client::TrackSelectScene::trackPick
private
bool HoverRace::Client::TrackSelectScene::trackSelected
private

Are we exiting because a track was selected?


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