YAPOG  0.0.1
Yet Another Pokemon Online Game
yap::GameScreen Class Reference

A basic implementation of IGameScreen, a game phase. More...

#include <GameScreen.hpp>

Inheritance diagram for yap::GameScreen:
Collaboration diagram for yap::GameScreen:

List of all members.

Public Member Functions

 GameScreen (const ScreenType &type)
 Initializes a GameScreen with the ScreenType type.
virtual ~GameScreen ()
IGameScreen members.
virtual void Init ()
 Called once after the add into a IGameScreenManager.
virtual void Activate ()
 Called each time this IGameScreen is slected to be run.
virtual void Deactivate ()
 Called each time this IGameScreen is not running anymore.
virtual void NextFrame ()
virtual const ScreenTypeRun (const Time &dt, IDrawingContext &context)
 Performs one frame of the screen life.
virtual const GuiManagerGetGuiManager () const
 Gets the root widget of this Screen.
virtual GuiManagerGetGuiManager ()
 Gets the root widget of this Screen.
virtual const ScreenTypeGetType () const
 Gets the unique type name of this Screen.
virtual Event< IGameScreen & > & OnGameExitedEvent ()
IEventHandler members.
virtual bool OnEvent (const GuiEvent &guiEvent)
 Treats an event. Transferts the event before treating it.
virtual bool OnPriorityEvent (const GuiEvent &guiEvent)
 Treats an event. Treats the event before transfering it.
- Public Member Functions inherited from yap::IGameScreen
virtual ~IGameScreen ()
- Public Member Functions inherited from yap::IEventHandler
virtual ~IEventHandler ()

Public Attributes

Event< IGameScreen & > OnGameExited

Protected Member Functions

void ExitGame ()
virtual void CreateGuiManager ()
virtual void HandleRun (const Time &dt, IDrawingContext &context)
 Behavior of Run.
virtual void HandleInit ()
 Behavior of Init.
virtual void HandleActivate ()
 Behavior of Activate.
virtual void HandleDeactivate ()
 Behavior of Deactivate.
virtual bool HandleOnEvent (const GuiEvent &guiEvent)
 Behavior of OnEvent.
virtual bool HandleOnPriorityEvent (const GuiEvent &guiEvent)
 Behavior of OnPriorityEvent.

Protected Attributes

ScreenType nextScreen_
 Type of the Screen to be executed on next frame.
GuiManagerguiManager_
 Root widget if this GameScreen.

Private Member Functions

 DISALLOW_COPY (GameScreen)

Private Attributes

ScreenType type_
 Type of this GameScreen.

Detailed Description

A basic implementation of IGameScreen, a game phase.

Definition at line 10 of file GameScreen.hpp.


Constructor & Destructor Documentation

yap::GameScreen::GameScreen ( const ScreenType type)
explicit

Initializes a GameScreen with the ScreenType type.

Parameters:
typeScreenType of this GameScreen.

Definition at line 7 of file GameScreen.cpp.

yap::GameScreen::~GameScreen ( )
virtual

Definition at line 14 of file GameScreen.cpp.


Member Function Documentation

void yap::GameScreen::Activate ( )
virtual

Called each time this IGameScreen is slected to be run.

Implements yap::IGameScreen.

Definition at line 25 of file GameScreen.cpp.

Here is the call graph for this function:

void yap::GameScreen::CreateGuiManager ( )
protectedvirtual

Reimplemented in ycl::GameplayScreen.

Definition at line 95 of file GameScreen.cpp.

Here is the caller graph for this function:

void yap::GameScreen::Deactivate ( )
virtual

Called each time this IGameScreen is not running anymore.

Implements yap::IGameScreen.

Definition at line 30 of file GameScreen.cpp.

Here is the call graph for this function:

yap::GameScreen::DISALLOW_COPY ( GameScreen  )
private
void yap::GameScreen::ExitGame ( )
protected

Definition at line 90 of file GameScreen.cpp.

Here is the caller graph for this function:

const GuiManager & yap::GameScreen::GetGuiManager ( ) const
virtual

Gets the root widget of this Screen.

Returns:
A constant reference to the root widget of this Screen.

Implements yap::IGameScreen.

Definition at line 54 of file GameScreen.cpp.

GuiManager & yap::GameScreen::GetGuiManager ( )
virtual

Gets the root widget of this Screen.

Returns:
A non-constant reference to the root widget of this Screen.

Implements yap::IGameScreen.

Definition at line 59 of file GameScreen.cpp.

const ScreenType & yap::GameScreen::GetType ( ) const
virtual

Gets the unique type name of this Screen.

Implements yap::IGameScreen.

Definition at line 64 of file GameScreen.cpp.

void yap::GameScreen::HandleActivate ( )
protectedvirtual

Behavior of Activate.

Reimplemented in ycl::GameplayScreen, ycl::SplashScreen, ycl::BattleScreen, and ycl::UpdateScreen.

Definition at line 111 of file GameScreen.cpp.

Here is the caller graph for this function:

void yap::GameScreen::HandleDeactivate ( )
protectedvirtual

Behavior of Deactivate.

Reimplemented in ycl::GameplayScreen, ycl::BattleScreen, ycl::LoginScreen, and ycl::RegistrationScreen.

Definition at line 115 of file GameScreen.cpp.

Here is the caller graph for this function:

void yap::GameScreen::HandleInit ( )
protectedvirtual

Behavior of Init.

Reimplemented in ycl::GameplayScreen, ycl::SplashScreen, ycl::UpdateScreen, ycl::BattleScreen, ycl::LoginScreen, ycl::RegistrationScreen, and ycl::MainMenuScreen.

Definition at line 106 of file GameScreen.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool yap::GameScreen::HandleOnEvent ( const GuiEvent guiEvent)
protectedvirtual

Behavior of OnEvent.

Reimplemented in ycl::GameplayScreen, and ycl::SplashScreen.

Definition at line 119 of file GameScreen.cpp.

Here is the caller graph for this function:

bool yap::GameScreen::HandleOnPriorityEvent ( const GuiEvent guiEvent)
protectedvirtual

Behavior of OnPriorityEvent.

Reimplemented in ycl::LoginScreen, and ycl::RegistrationScreen.

Definition at line 124 of file GameScreen.cpp.

Here is the caller graph for this function:

void yap::GameScreen::HandleRun ( const Time dt,
IDrawingContext context 
)
protectedvirtual

Behavior of Run.

Reimplemented in ycl::GameplayScreen, ycl::UpdateScreen, ycl::BattleScreen, ycl::LoginScreen, ycl::SplashScreen, ycl::RegistrationScreen, ycl::MainMenuScreen, ycl::CreditScreen, and ycl::LoadingScreen.

Definition at line 100 of file GameScreen.cpp.

Here is the caller graph for this function:

void yap::GameScreen::Init ( )
virtual

Called once after the add into a IGameScreenManager.

Implements yap::IGameScreen.

Definition at line 20 of file GameScreen.cpp.

Here is the call graph for this function:

void yap::GameScreen::NextFrame ( )
virtual

Implements yap::IGameScreen.

Definition at line 35 of file GameScreen.cpp.

bool yap::GameScreen::OnEvent ( const GuiEvent guiEvent)
virtual

Treats an event. Transferts the event before treating it.

Parameters:
guiEventThe event to treat.
Returns:
True if the handler is concerned by the events and treated it, else false.

Implements yap::IEventHandler.

Definition at line 74 of file GameScreen.cpp.

Here is the call graph for this function:

Event< IGameScreen & > & yap::GameScreen::OnGameExitedEvent ( )
virtual

Implements yap::IGameScreen.

Definition at line 69 of file GameScreen.cpp.

bool yap::GameScreen::OnPriorityEvent ( const GuiEvent guiEvent)
virtual

Treats an event. Treats the event before transfering it.

Parameters:
guiEventThe event to treat.
Returns:
True if the handler is concerned by the events and treated it, else false.

Implements yap::IEventHandler.

Definition at line 82 of file GameScreen.cpp.

Here is the call graph for this function:

const ScreenType & yap::GameScreen::Run ( const Time dt,
IDrawingContext context 
)
virtual

Performs one frame of the screen life.

Parameters:
dtDelta time elapsed since last frame.
contextDrawing context where are drawn graphical elements.
Returns:
Next screen type that must be executed. By default, the returned type is the type of this Screen.

Implements yap::IGameScreen.

Definition at line 40 of file GameScreen.cpp.

Here is the call graph for this function:


Member Data Documentation

GuiManager* yap::GameScreen::guiManager_
protected

Root widget if this GameScreen.

Definition at line 71 of file GameScreen.hpp.

ScreenType yap::GameScreen::nextScreen_
protected

Type of the Screen to be executed on next frame.

Definition at line 69 of file GameScreen.hpp.

Event<IGameScreen&> yap::GameScreen::OnGameExited

Definition at line 45 of file GameScreen.hpp.

ScreenType yap::GameScreen::type_
private

Type of this GameScreen.

Definition at line 76 of file GameScreen.hpp.


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