Engine::LoadScene< T, Q > Class Template Reference

Load a game. More...

#include <LoadScene.h>

Inheritance diagram for Engine::LoadScene< T, Q >:

Engine::Scene List of all members.

Public Member Functions

 LoadScene (std::vector< std::pair< InputHandler::iterator, unsigned int > > input_devices, std::string filename, unsigned int number_of_ais=0)
 Load a game where the players use specified input devices.
virtual ~LoadScene ()
virtual void take_input (InputReport &report)
 Take input from an input device.
virtual void update_logic (unsigned int milliseconds_elapsed)
 Process any status changes that occur due to elapsed time.
virtual void draw ()
 Draw the scene using OpenGL commands.
virtual void do_sound ()
 Update the audio.
void set_done_notifier (Q *function_object_in)
 Give a function object the a reference to the scene when it's ready.

Private Attributes

bool blanked
std::string track_filename
 The filename of the track.
boost::shared_ptr< std::ifstream > track_file
std::string theme_filename
 The filename of the theme the track uses.
boost::shared_ptr< std::ifstream > theme_file
boost::shared_ptr< Track::Themetheme
 Theme the track uses.
boost::shared_ptr< Track::Tracktrack
 The course to play on.
std::vector< boost::shared_ptr<
Engine::InputDeviceAI > > 
m_ai_devices
 The InputDevices for the computer controlled players.
std::vector< std::pair< InputHandler::iterator,
unsigned int > > 
input_devices
 Devices to use for inputs paired with chosen car.
boost::shared_ptr< T > game_scene
Q * function_object
 object to send new scene to.
bool done
bool error
 True if and only if track cannot be loaded.
unsigned int m_number_of_ais
 The number of computer controlled cars requested.

Detailed Description

template<class T = GameScene, class Q = daft_function_object<T>>
class Engine::LoadScene< T, Q >

Load a game.

class of scene to create. Must be an Engine::Scene constuctable with a std::vector<std::size_t> picking the input devices and a Track::Track for the track.

Definition at line 48 of file LoadScene.h.


Constructor & Destructor Documentation

template<class T = GameScene, class Q = daft_function_object<T>>
Engine::LoadScene< T, Q >::LoadScene ( std::vector< std::pair< InputHandler::iterator, unsigned int > >  input_devices,
std::string  filename,
unsigned int  number_of_ais = 0 
) [inline]

Load a game where the players use specified input devices.

Parameters:
input_devices InputHandler iterators for devices to use, paired with the car each device's user wants. The order is important.
filename The filename of the track.
number_of_ais The number of AI players wanted.

Definition at line 57 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
virtual Engine::LoadScene< T, Q >::~LoadScene (  )  [inline, virtual]

Definition at line 71 of file LoadScene.h.


Member Function Documentation

template<class T = GameScene, class Q = daft_function_object<T>>
virtual void Engine::LoadScene< T, Q >::do_sound (  )  [inline, virtual]

Update the audio.

Implements Engine::Scene.

Definition at line 235 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
virtual void Engine::LoadScene< T, Q >::draw (  )  [inline, virtual]

Draw the scene using OpenGL commands.

Must go from any state to ready for a buffer swap.

Implements Engine::Scene.

Definition at line 216 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
void Engine::LoadScene< T, Q >::set_done_notifier ( Q *  function_object_in  )  [inline]

Give a function object the a reference to the scene when it's ready.

Definition at line 240 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
virtual void Engine::LoadScene< T, Q >::take_input ( InputReport report  )  [inline, virtual]

Take input from an input device.

Parameters:
report An input report, which may be freed immediately after the call returns.

Implements Engine::Scene.

Definition at line 75 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
virtual void Engine::LoadScene< T, Q >::update_logic ( unsigned int  milliseconds_elapsed  )  [inline, virtual]

Process any status changes that occur due to elapsed time.

Parameters:
milliseconds_elapsed time in milliseconds since last update_logic.

Implements Engine::Scene.

Definition at line 102 of file LoadScene.h.


Member Data Documentation

template<class T = GameScene, class Q = daft_function_object<T>>
bool Engine::LoadScene< T, Q >::blanked [private]

Definition at line 245 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
bool Engine::LoadScene< T, Q >::done [private]

Definition at line 268 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
bool Engine::LoadScene< T, Q >::error [private]

True if and only if track cannot be loaded.

Definition at line 271 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
Q* Engine::LoadScene< T, Q >::function_object [private]

object to send new scene to.

Definition at line 266 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
boost::shared_ptr<T> Engine::LoadScene< T, Q >::game_scene [private]

Definition at line 263 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
std::vector<std::pair<InputHandler::iterator, unsigned int> > Engine::LoadScene< T, Q >::input_devices [private]

Devices to use for inputs paired with chosen car.

Definition at line 261 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
std::vector<boost::shared_ptr<Engine::InputDeviceAI> > Engine::LoadScene< T, Q >::m_ai_devices [private]

The InputDevices for the computer controlled players.

Definition at line 258 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
unsigned int Engine::LoadScene< T, Q >::m_number_of_ais [private]

The number of computer controlled cars requested.

Definition at line 274 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
boost::shared_ptr<Track::Theme> Engine::LoadScene< T, Q >::theme [private]

Theme the track uses.

Definition at line 253 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
boost::shared_ptr<std::ifstream> Engine::LoadScene< T, Q >::theme_file [private]

Definition at line 251 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
std::string Engine::LoadScene< T, Q >::theme_filename [private]

The filename of the theme the track uses.

Definition at line 250 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
boost::shared_ptr<Track::Track> Engine::LoadScene< T, Q >::track [private]

The course to play on.

Definition at line 255 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
boost::shared_ptr<std::ifstream> Engine::LoadScene< T, Q >::track_file [private]

Definition at line 248 of file LoadScene.h.

template<class T = GameScene, class Q = daft_function_object<T>>
std::string Engine::LoadScene< T, Q >::track_filename [private]

The filename of the track.

Definition at line 247 of file LoadScene.h.


The documentation for this class was generated from the following file:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.