HoverRace  2.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
HoverRace::MainCharacter::MainCharacter Class Reference

#include <MainCharacter.h>

+ Inheritance diagram for HoverRace::MainCharacter::MainCharacter:

Classes

class  Cylinder
 

Public Types

enum  : unsigned int {
  eMotorOn = 1, eRight = 2, eLeft = 4, eStraffleRight = 8,
  eLookBack = 8, eStraffleLeft = 16, eBreakDirection = 32, eJump = 64,
  eFire = 128, eSlowRotation = 1024, eSelectWeapon = 2048
}
 
using checkpointSignal_t = boost::signals2::signal< void(MainCharacter *, int)>
 
enum  eWeapon { eMissile, eMine, ePowerUp, eNotAWeapon }
 
using finishedSignal_t = boost::signals2::signal< void(MainCharacter *)>
 
using finishLineSignal_t = boost::signals2::signal< void(MainCharacter *)>
 
using startedSignal_t = boost::signals2::signal< void(MainCharacter *)>
 

Public Member Functions

virtual ~MainCharacter ()
 
void AddRenderer () override
 
void Finish ()
 Signal that the player's session has ended. More...
 
double GetAbsoluteSpeed () const
 
MR_Angle GetCabinOrientation () const
 
checkpointSignal_tGetCheckpointSignal ()
 
eWeapon GetCurrentWeapon () const
 
double GetDirectionalSpeed () const
 
finishedSignal_tGetFinishedSignal ()
 
finishLineSignal_tGetFinishLineSignal ()
 
double GetFuelLevel () const
 Retrieve the relative amount of fuel remaining. More...
 
int GetHitQueue ()
 
int GetHoverId () const
 
unsigned int GetHoverModel () const
 
MR_SimulationTime GetLastLapCompletion () const
 
MR_SimulationTime GetLastLapDuration () const
 
int GetMineCount () const
 
int GetMissileRefillLevel (int pNbLevel) const
 
Model::ElementNetState GetNetState () const override
 
int GetPlayerIndex () const
 
int GetPowerUpCount () const
 
int GetPowerUpFraction (int pNbLevel) const
 
startedSignal_tGetStartedSignal ()
 
MR_SimulationTime GetTotalTime () const
 
bool HasFinish () const
 Determine if the player's session has ended. More...
 
bool HasStarted () const
 Determine if the player has started playing (pregame is over and the player has control of the craft). More...
 
int HitQueueCount () const
 
void PlayExternalSounds (int pDB, int pPan) override
 
void PlayInternalSounds () override
 
void Render (VideoServices::Viewport3D *pDest, MR_SimulationTime pTime) override
 
void SetAsMaster ()
 
void SetAsSlave ()
 
void SetBrakeState (bool brakeState)
 
void SetChangeItem ()
 
void SetEngineState (bool engineState)
 
void SetHoverId (int pId)
 
void SetHoverModel (unsigned int pModel)
 
void SetJump ()
 
void SetLookBackState (bool lookBackState)
 
void SetNetState (int pDataLen, const MR_UInt8 *pData) override
 
void SetOrientation (MR_Angle pOrientation)
 
void SetPowerup ()
 
void SetSimulationTime (MR_SimulationTime pTime)
 
void SetTurnLeftState (bool leftState)
 
void SetTurnRightState (bool rightState)
 
- Public Member Functions inherited from HoverRace::Model::FreeElement
 FreeElement (const Util::ObjectFromFactoryId &id={0, 0})
 
virtual ~FreeElement ()
 
virtual bool AssignPermNumber (int pNumber)
 Assign a permanent hook number. More...
 
virtual void SetOwnerId (int pOwnerId)
 
- Public Member Functions inherited from HoverRace::Model::Element
 Element (const Util::ObjectFromFactoryId &id)
 
virtual ~Element ()
 
void ApplyEffects (const ContactEffectList *pList, MR_SimulationTime pTime, MR_SimulationTime pDuration, BOOL pValidDirection, MR_Angle pHorizontalDirection, MR_Int32 pZMin, MR_Int32 pZMax, Track &track)
 
void Serialize (Parcel::ObjStream &) overridefinal
 
- Public Member Functions inherited from HoverRace::Util::ObjectFromFactory
 ObjectFromFactory (const ObjectFromFactoryId &pId) noexcept
 
virtual ~ObjectFromFactory ()
 
const ObjectFromFactoryIdGetTypeId () const noexcept
 

Static Public Member Functions

static MainCharacterNew (int idx, char pGameOpts)
 Create a new player. More...
 
- Static Public Member Functions inherited from HoverRace::Util::ObjectFromFactory
template<class T >
static void SerializeShared (Parcel::ObjStream &archive, typename std::enable_if< std::is_base_of< ObjectFromFactory, T >::value, std::shared_ptr< T >>::type &obj)
 Serialize a shared pointer to a serializable object. More...
 

Public Attributes

MR_SimulationTime mLastCollisionTime
 
BOOL mNetPriority
 
int mRoom
 
- Public Attributes inherited from HoverRace::Model::FreeElement
MR_Angle mOrientation
 
MR_3DCoordinate mPosition
 

Protected Member Functions

void ApplyEffect (const Model::ContactEffect *pEffect, MR_SimulationTime pTime, MR_SimulationTime pDuration, BOOL pValidDirection, MR_Angle pHorizontalDirection, MR_Int32 pZMin, MR_Int32 pZMax, Model::Track &track) override
 
const Model::ContactEffectListGetEffectList () override
 
const Model::ShapeInterfaceGetGivingContactEffectShape () override
 Get the shape that gives an effect when touching while moving. More...
 
const Model::ShapeInterfaceGetObstacleShape () override
 Get the shape that stops other elements' movement. More...
 
const Model::ShapeInterfaceGetReceivingContactEffectShape () override
 Get the shape that gives an effect when touched by a moving element. More...
 
int Simulate (MR_SimulationTime pDuration, Model::Track &track, int pRoom) override
 Advance the simulation. More...
 

Private Member Functions

 MainCharacter ()
 
int InternalSimulate (MR_SimulationTime pDuration, Model::Track &track, int pRoom)
 

Private Attributes

checkpointSignal_t checkpointSignal
 
bool finished
 
finishedSignal_t finishedSignal
 
finishLineSignal_t finishLineSignal
 
MR_Angle mCabinOrientation
 
BOOL mCheckPoint1
 
BOOL mCheckPoint2
 
Cylinder mCollisionShape
 
Model::PhysicalCollision mContactEffect
 
Model::ContactEffectList mContactEffectList
 
Cylinder mContactShape
 
unsigned int mControlState
 
MR_SimulationTime mCurrentTime
 
eWeapon mCurrentWeapon
 
MR_FixedFastFifo< VideoServices::ShortSound *, 6 > mExternalSoundList
 
BOOL mFireDone
 
double mFuelLevel
 
char mGameOpts
 
int mHoverId
 
unsigned mHoverModel
 
MR_FixedFastFifo< VideoServices::ShortSound *, 6 > mInternalSoundList
 
MR_FixedFastFifo< int, 6 > mLastHits
 
MR_SimulationTime mLastLapCompletion
 
MR_SimulationTime mLastLapDuration
 
BOOL mMasterMode
 
MR_FixedFastFifo< int, 2 > mMineList
 
MR_SimulationTime mMissileRefillDuration
 
int mMotorDisplay
 
BOOL mMotorOnState
 
BOOL mOnFloor
 
MR_SimulationTime mOutOfControlDuration
 
MR_SimulationTime mPowerUpLeft
 
MR_FixedFastFifo< int, 4 > mPowerUpList
 
std::shared_ptr< MainCharacterRenderermRenderer
 
double mXSpeed
 
double mXSpeedBeforeCollision
 
double mYSpeed
 
double mYSpeedBeforeCollision
 
double mZSpeed
 
int playerIdx
 
bool started
 
startedSignal_t startedSignal
 

Member Typedef Documentation

using HoverRace::MainCharacter::MainCharacter::checkpointSignal_t = boost::signals2::signal<void(MainCharacter*, int)>

Member Enumeration Documentation

anonymous enum : unsigned int
Enumerator
eMotorOn 
eRight 
eLeft 
eStraffleRight 
eLookBack 
eStraffleLeft 
eBreakDirection 
eJump 
eFire 
eSlowRotation 
eSelectWeapon 
Enumerator
eMissile 
eMine 
ePowerUp 
eNotAWeapon 

Constructor & Destructor Documentation

HoverRace::MainCharacter::MainCharacter::MainCharacter ( )
private
HoverRace::MainCharacter::MainCharacter::~MainCharacter ( )
virtual

Member Function Documentation

void HoverRace::MainCharacter::MainCharacter::AddRenderer ( )
overridevirtual

Reimplemented from HoverRace::Model::Element.

void HoverRace::MainCharacter::MainCharacter::ApplyEffect ( const Model::ContactEffect pEffect,
MR_SimulationTime  pTime,
MR_SimulationTime  pDuration,
BOOL  pValidDirection,
MR_Angle  pHorizontalDirection,
MR_Int32  pZMin,
MR_Int32  pZMax,
Model::Track track 
)
overrideprotectedvirtual

Reimplemented from HoverRace::Model::Element.

void HoverRace::MainCharacter::MainCharacter::Finish ( )

Signal that the player's session has ended.

double HoverRace::MainCharacter::MainCharacter::GetAbsoluteSpeed ( ) const
MR_Angle HoverRace::MainCharacter::MainCharacter::GetCabinOrientation ( ) const
checkpointSignal_t& HoverRace::MainCharacter::MainCharacter::GetCheckpointSignal ( )
inline
MainCharacter::eWeapon HoverRace::MainCharacter::MainCharacter::GetCurrentWeapon ( ) const
double HoverRace::MainCharacter::MainCharacter::GetDirectionalSpeed ( ) const
const Model::ContactEffectList * HoverRace::MainCharacter::MainCharacter::GetEffectList ( )
overrideprotectedvirtual

Reimplemented from HoverRace::Model::Element.

finishedSignal_t& HoverRace::MainCharacter::MainCharacter::GetFinishedSignal ( )
inline
finishLineSignal_t& HoverRace::MainCharacter::MainCharacter::GetFinishLineSignal ( )
inline
double HoverRace::MainCharacter::MainCharacter::GetFuelLevel ( ) const

Retrieve the relative amount of fuel remaining.

Returns
The fuel level, where 1.0 or higher is full and 0.0 or lower is empty.
const Model::ShapeInterface * HoverRace::MainCharacter::MainCharacter::GetGivingContactEffectShape ( )
overrideprotectedvirtual

Get the shape that gives an effect when touching while moving.

Returns
The shape, or nullptr if none.

Reimplemented from HoverRace::Model::FreeElement.

int HoverRace::MainCharacter::MainCharacter::GetHitQueue ( )
int HoverRace::MainCharacter::MainCharacter::GetHoverId ( ) const
unsigned int HoverRace::MainCharacter::MainCharacter::GetHoverModel ( ) const
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::GetLastLapCompletion ( ) const
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::GetLastLapDuration ( ) const
int HoverRace::MainCharacter::MainCharacter::GetMineCount ( ) const
int HoverRace::MainCharacter::MainCharacter::GetMissileRefillLevel ( int  pNbLevel) const
Model::ElementNetState HoverRace::MainCharacter::MainCharacter::GetNetState ( ) const
overridevirtual

Reimplemented from HoverRace::Model::FreeElement.

const Model::ShapeInterface * HoverRace::MainCharacter::MainCharacter::GetObstacleShape ( )
overrideprotectedvirtual

Get the shape that stops other elements' movement.

Returns
The shape, or nullptr if none.

Reimplemented from HoverRace::Model::FreeElement.

int HoverRace::MainCharacter::MainCharacter::GetPlayerIndex ( ) const
inline
int HoverRace::MainCharacter::MainCharacter::GetPowerUpCount ( ) const
int HoverRace::MainCharacter::MainCharacter::GetPowerUpFraction ( int  pNbLevel) const
const Model::ShapeInterface * HoverRace::MainCharacter::MainCharacter::GetReceivingContactEffectShape ( )
overrideprotectedvirtual

Get the shape that gives an effect when touched by a moving element.

Returns
The shape, or nullptr if none.

Reimplemented from HoverRace::Model::FreeElement.

startedSignal_t& HoverRace::MainCharacter::MainCharacter::GetStartedSignal ( )
inline
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::GetTotalTime ( ) const
bool HoverRace::MainCharacter::MainCharacter::HasFinish ( ) const

Determine if the player's session has ended.

Returns
true if the session is over, false if the player is still playing.
bool HoverRace::MainCharacter::MainCharacter::HasStarted ( ) const

Determine if the player has started playing (pregame is over and the player has control of the craft).

Returns
true if the play session has started, false if still in pregame.
int HoverRace::MainCharacter::MainCharacter::HitQueueCount ( ) const
int HoverRace::MainCharacter::MainCharacter::InternalSimulate ( MR_SimulationTime  pDuration,
Model::Track track,
int  pRoom 
)
private
MainCharacter * HoverRace::MainCharacter::MainCharacter::New ( int  idx,
char  gameopts 
)
static

Create a new player.

Parameters
idxThe player index (starting at 0 for player 1).
gameoptsThe game options.
void HoverRace::MainCharacter::MainCharacter::PlayExternalSounds ( int  pDB,
int  pPan 
)
overridevirtual

Reimplemented from HoverRace::Model::FreeElement.

void HoverRace::MainCharacter::MainCharacter::PlayInternalSounds ( )
overridevirtual

Reimplemented from HoverRace::Model::FreeElement.

void HoverRace::MainCharacter::MainCharacter::Render ( VideoServices::Viewport3D pDest,
MR_SimulationTime  pTime 
)
overridevirtual

Reimplemented from HoverRace::Model::FreeElement.

void HoverRace::MainCharacter::MainCharacter::SetAsMaster ( )
void HoverRace::MainCharacter::MainCharacter::SetAsSlave ( )
void HoverRace::MainCharacter::MainCharacter::SetBrakeState ( bool  brakeState)
void HoverRace::MainCharacter::MainCharacter::SetChangeItem ( )
void HoverRace::MainCharacter::MainCharacter::SetEngineState ( bool  engineState)
void HoverRace::MainCharacter::MainCharacter::SetHoverId ( int  pId)
void HoverRace::MainCharacter::MainCharacter::SetHoverModel ( unsigned int  pModel)
void HoverRace::MainCharacter::MainCharacter::SetJump ( )
void HoverRace::MainCharacter::MainCharacter::SetLookBackState ( bool  lookBackState)
void HoverRace::MainCharacter::MainCharacter::SetNetState ( int  pDataLen,
const MR_UInt8 pData 
)
overridevirtual

Reimplemented from HoverRace::Model::FreeElement.

void HoverRace::MainCharacter::MainCharacter::SetOrientation ( MR_Angle  pOrientation)
void HoverRace::MainCharacter::MainCharacter::SetPowerup ( )
void HoverRace::MainCharacter::MainCharacter::SetSimulationTime ( MR_SimulationTime  pTime)
void HoverRace::MainCharacter::MainCharacter::SetTurnLeftState ( bool  leftState)
void HoverRace::MainCharacter::MainCharacter::SetTurnRightState ( bool  rightState)
int HoverRace::MainCharacter::MainCharacter::Simulate ( MR_SimulationTime  pTimeSlice,
Model::Track track,
int  pRoom 
)
overrideprotectedvirtual

Advance the simulation.

Parameters
pTimeSliceThe time slice to simulate over.
trackThe track.
pRoomThe room number.
Returns
The new room number.

Reimplemented from HoverRace::Model::FreeElement.

Member Data Documentation

checkpointSignal_t HoverRace::MainCharacter::MainCharacter::checkpointSignal
private
bool HoverRace::MainCharacter::MainCharacter::finished
private
finishedSignal_t HoverRace::MainCharacter::MainCharacter::finishedSignal
private
finishLineSignal_t HoverRace::MainCharacter::MainCharacter::finishLineSignal
private
MR_Angle HoverRace::MainCharacter::MainCharacter::mCabinOrientation
private
BOOL HoverRace::MainCharacter::MainCharacter::mCheckPoint1
private
BOOL HoverRace::MainCharacter::MainCharacter::mCheckPoint2
private
Cylinder HoverRace::MainCharacter::MainCharacter::mCollisionShape
private
Model::PhysicalCollision HoverRace::MainCharacter::MainCharacter::mContactEffect
private
Model::ContactEffectList HoverRace::MainCharacter::MainCharacter::mContactEffectList
private
Cylinder HoverRace::MainCharacter::MainCharacter::mContactShape
private
unsigned int HoverRace::MainCharacter::MainCharacter::mControlState
private
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::mCurrentTime
private
eWeapon HoverRace::MainCharacter::MainCharacter::mCurrentWeapon
private
MR_FixedFastFifo<VideoServices::ShortSound*, 6> HoverRace::MainCharacter::MainCharacter::mExternalSoundList
private
BOOL HoverRace::MainCharacter::MainCharacter::mFireDone
private
double HoverRace::MainCharacter::MainCharacter::mFuelLevel
private
char HoverRace::MainCharacter::MainCharacter::mGameOpts
private
int HoverRace::MainCharacter::MainCharacter::mHoverId
private
unsigned HoverRace::MainCharacter::MainCharacter::mHoverModel
private
MR_FixedFastFifo<VideoServices::ShortSound*, 6> HoverRace::MainCharacter::MainCharacter::mInternalSoundList
private
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::mLastCollisionTime
MR_FixedFastFifo<int, 6> HoverRace::MainCharacter::MainCharacter::mLastHits
private
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::mLastLapCompletion
private
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::mLastLapDuration
private
BOOL HoverRace::MainCharacter::MainCharacter::mMasterMode
private
MR_FixedFastFifo<int, 2> HoverRace::MainCharacter::MainCharacter::mMineList
private
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::mMissileRefillDuration
private
int HoverRace::MainCharacter::MainCharacter::mMotorDisplay
private
BOOL HoverRace::MainCharacter::MainCharacter::mMotorOnState
private
BOOL HoverRace::MainCharacter::MainCharacter::mNetPriority
BOOL HoverRace::MainCharacter::MainCharacter::mOnFloor
private
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::mOutOfControlDuration
private
MR_SimulationTime HoverRace::MainCharacter::MainCharacter::mPowerUpLeft
private
MR_FixedFastFifo<int, 4> HoverRace::MainCharacter::MainCharacter::mPowerUpList
private
std::shared_ptr<MainCharacterRenderer> HoverRace::MainCharacter::MainCharacter::mRenderer
private
int HoverRace::MainCharacter::MainCharacter::mRoom
double HoverRace::MainCharacter::MainCharacter::mXSpeed
private
double HoverRace::MainCharacter::MainCharacter::mXSpeedBeforeCollision
private
double HoverRace::MainCharacter::MainCharacter::mYSpeed
private
double HoverRace::MainCharacter::MainCharacter::mYSpeedBeforeCollision
private
double HoverRace::MainCharacter::MainCharacter::mZSpeed
private
int HoverRace::MainCharacter::MainCharacter::playerIdx
private
bool HoverRace::MainCharacter::MainCharacter::started
private
startedSignal_t HoverRace::MainCharacter::MainCharacter::startedSignal
private

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