Track::Theme Class Reference

A track theme. More...

#include <Theme.h>

List of all members.

Public Member Functions

 Theme (std::istream &source)
 Construct a theme object from an input stream.
virtual ~Theme ()
 Destruct the theme and free all the pieces.
const Skyboxget_skybox () const
 get a reference to the skybox object.
std::size_t get_number_of_segments () const
 get the number of track segments types avalible for tracks in this theme.
const Segmentget_segment (std::size_t index) const
 get a segment by index.
const std::string & get_name () const
 get the name of the theme.
std::size_t get_segment_index (std::string name) const
 Get the index of a segment by name.
std::size_t get_default_segment_index () const
 Get the index of the default segment.
bool get_use_sky_particles () const
 Return true iff the theme should use racer's Graphics::SkyParticles.

Protected Member Functions

void find_default_segment ()

Protected Attributes

Skybox skybox
 The skybox for the background in this theme.
std::vector< boost::shared_ptr<
Segment > > 
segments
 The different track segments useable in this theme.
std::string name
 The name of the theme. Will appear as a track property.
std::size_t m_default_segment_index
 True iff the theme should use racer's Graphics::SkyParticles.
bool m_use_sky_particles


Detailed Description

A track theme.

Includes the sky, the types of track avaiable, and random decorative meshes. It isn't quite swappable across tracks since the themes can define different track segments which have variable constraints to their placement.

Definition at line 31 of file Theme.h.


Constructor & Destructor Documentation

Track::Theme::Theme ( std::istream &  source  ) 

Construct a theme object from an input stream.

This will advance the stream to the end of the theme description.

An error may be thrown if the stream is truncated or malformed.

Parameters:
source A reference to the stream to take construction values from.

Definition at line 21 of file Theme.cpp.

Track::Theme::~Theme (  )  [virtual]

Destruct the theme and free all the pieces.

Definition at line 34 of file Theme.cpp.


Member Function Documentation

void Track::Theme::find_default_segment (  )  [protected]

Definition at line 87 of file Theme.cpp.

std::size_t Track::Theme::get_default_segment_index (  )  const

Get the index of the default segment.

Definition at line 77 of file Theme.cpp.

const std::string & Track::Theme::get_name (  )  const

get the name of the theme.

Definition at line 55 of file Theme.cpp.

std::size_t Track::Theme::get_number_of_segments (  )  const

get the number of track segments types avalible for tracks in this theme.

Returns:
the number of track segments avaliable.

Definition at line 44 of file Theme.cpp.

const Segment & Track::Theme::get_segment ( std::size_t  index  )  const

get a segment by index.

Parameters:
index The of the segment from 0 to one less than the value returned by get_number_of_segments.
Returns:
a const reference to the segment requested.

Definition at line 49 of file Theme.cpp.

std::size_t Track::Theme::get_segment_index ( std::string  name  )  const

Get the index of a segment by name.

Definition at line 60 of file Theme.cpp.

const Skybox & Track::Theme::get_skybox (  )  const

get a reference to the skybox object.

Returns:
A reference to the skybox that is the background in this theme.

Definition at line 39 of file Theme.cpp.

bool Track::Theme::get_use_sky_particles (  )  const

Return true iff the theme should use racer's Graphics::SkyParticles.

Definition at line 82 of file Theme.cpp.


Member Data Documentation

std::size_t Track::Theme::m_default_segment_index [protected]

True iff the theme should use racer's Graphics::SkyParticles.

Definition at line 81 of file Theme.h.

bool Track::Theme::m_use_sky_particles [protected]

Definition at line 85 of file Theme.h.

std::string Track::Theme::name [protected]

The name of the theme. Will appear as a track property.

Definition at line 78 of file Theme.h.

std::vector<boost::shared_ptr<Segment> > Track::Theme::segments [protected]

The different track segments useable in this theme.

Definition at line 76 of file Theme.h.

Skybox Track::Theme::skybox [protected]

The skybox for the background in this theme.

Definition at line 74 of file Theme.h.


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

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