HoverRace  2.0
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HoverRace::Model::Track Class Reference

A track level. More...

#include <Track.h>

+ Inheritance diagram for HoverRace::Model::Track:

Classes

struct  Physics
 

Public Member Functions

 Track (const std::string &name, std::shared_ptr< Parcel::RecordFile > recFile={})
 Constructor. More...
 
virtual ~Track ()
 
void AddFreeElement (std::shared_ptr< Model::FreeElementBase > elem)
 Add a FreeElement to be managed by this Track. More...
 
double GetGravity () const
 Gets the gravity multiplier. More...
 
const TrackEntryGetHeader () const
 
LevelGetLevel () const
 
std::shared_ptr< Display::Res< Display::Texture > > GetMap () const
 
const Vec2GetOffset () const
 Retrieve the coordinates of the north-west corner of the track. More...
 
Parcel::RecordFileGetRecordFile () const
 
const Vec2GetSize () const
 Retrieve the size of the track. More...
 
void Inspect (Util::InspectMapNode &node) const override
 
void Load (bool allowRendering, const GameOptions &gameOpts)
 
void SetGravity (double gravity)
 Set the current gravity multiplier. More...
 
std::shared_ptr< Parcel::RecordFileShareRecordFile () const
 
- Public Member Functions inherited from HoverRace::Util::Inspectable
 Inspectable ()
 
virtual ~Inspectable ()
 

Private Types

using SUPER = Util::Inspectable
 

Private Member Functions

 Track ()=delete
 
void LoadHeader ()
 
void LoadLevel (bool allowRendering, const GameOptions &gameOpts)
 
void LoadMap ()
 

Private Attributes

std::list< std::shared_ptr< Model::FreeElementBase > > freeElements
 
TrackEntry header
 
std::unique_ptr< Levellevel
 
std::shared_ptr< Display::Res< Display::Texture > > map
 
Vec2 offset
 
struct HoverRace::Model::Track::Physics physics
 
std::shared_ptr< Parcel::RecordFilerecFile
 
Vec2 size
 

Detailed Description

A track level.

Author
Michael Imamura

Member Typedef Documentation

Constructor & Destructor Documentation

HoverRace::Model::Track::Track ( )
privatedelete
HoverRace::Model::Track::Track ( const std::string &  name,
std::shared_ptr< Parcel::RecordFile recFile = {} 
)

Constructor.

Parameters
nameThe name of the track.
recFileThe record file to load the track from (may be nullptr if in-memory only).
Exceptions
Parcel::ObjStreamExn
HoverRace::Model::Track::~Track ( )
virtual

Member Function Documentation

void HoverRace::Model::Track::AddFreeElement ( std::shared_ptr< Model::FreeElementBase >  elem)
inline

Add a FreeElement to be managed by this Track.

Parameters
elemThe element.
double HoverRace::Model::Track::GetGravity ( ) const
inline

Gets the gravity multiplier.

Returns
The gravity multiplier (1.0 is normal gravity).
const TrackEntry& HoverRace::Model::Track::GetHeader ( ) const
inline
Level* HoverRace::Model::Track::GetLevel ( ) const
inline
std::shared_ptr<Display::Res<Display::Texture> > HoverRace::Model::Track::GetMap ( ) const
inline
const Vec2& HoverRace::Model::Track::GetOffset ( ) const
inline

Retrieve the coordinates of the north-west corner of the track.

Returns
The coordinates, or (0, 0) if the track hasn't been loaded.
Parcel::RecordFile* HoverRace::Model::Track::GetRecordFile ( ) const
inline
const Vec2& HoverRace::Model::Track::GetSize ( ) const
inline

Retrieve the size of the track.

Returns
The size, or (0, 0) if the track hasn't been loaded.
void HoverRace::Model::Track::Inspect ( Util::InspectMapNode node) const
overridevirtual
void HoverRace::Model::Track::Load ( bool  allowRendering,
const GameOptions gameOpts 
)
void HoverRace::Model::Track::LoadHeader ( )
private
void HoverRace::Model::Track::LoadLevel ( bool  allowRendering,
const GameOptions gameOpts 
)
private
void HoverRace::Model::Track::LoadMap ( )
private
void HoverRace::Model::Track::SetGravity ( double  gravity)
inline

Set the current gravity multiplier.

Parameters
gravityThe gravity multiplier (1.0 is normal gravity).
std::shared_ptr<Parcel::RecordFile> HoverRace::Model::Track::ShareRecordFile ( ) const
inline

Member Data Documentation

std::list<std::shared_ptr<Model::FreeElementBase> > HoverRace::Model::Track::freeElements
private
TrackEntry HoverRace::Model::Track::header
private
std::unique_ptr<Level> HoverRace::Model::Track::level
private
std::shared_ptr<Display::Res<Display::Texture> > HoverRace::Model::Track::map
private
Vec2 HoverRace::Model::Track::offset
private
struct HoverRace::Model::Track::Physics HoverRace::Model::Track::physics
private
std::shared_ptr<Parcel::RecordFile> HoverRace::Model::Track::recFile
private
Vec2 HoverRace::Model::Track::size
private

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