PlayField Class Reference

Play field. More...

#include <play_field.h>

Inheritance diagram for PlayField:

TimeUpdateable GraphicalNode Templates::CallableBack< Avatar > Templates::CallableBack< BubbleField >

List of all members.

Public Member Functions

 PlayField (const SceneConfiguration &sceneConfig)
 Constructor.
 ~PlayField ()
 Destructor.
virtual void timeUpdate (float dt)
 Timer value change event occured.
virtual void callableBackNotify (BubbleField *subject)
 Subject performed action on which the callback was defined.
virtual void callableBackNotify (Avatar *subject)
 Subject performed action on which the callback was defined.
void fire ()
 Shoot a bubble.
void launchBubble ()
 This method is called when the bubble should be really fired.

Static Public Member Functions

static float getSizeHalfSize ()
 Returns half size of a single side of the play box.
static float getDepth ()
 Returns the depth of the play box.
static float getNearWallBound ()
 Returns the near bound of the back wall.

Private Member Functions

 PlayField (const PlayField &)
PlayFieldoperator= (const PlayField &)
void createNewBubble ()
 Adds non moving bubble which can be fired.
SbVec3f coordsInBubbleField (const SbVec3f &pfCoords)
 Translates coordinates from play field system to bubble field system.

Private Attributes

PlayBoxGraphics_graphics
 Strategy object that encapsulates an algorithm rendering the play field.
PlayBoxPhysics_physics
 Strategy object that encapsulates an algorithm in charge of physics.
Avatar_avatar
 Graphical representation of the player (the avatar).
Camera_camera
 Camera.
BubbleField_bubbleField
 "Glued-on" bubbles on the rear wall
Bubble_flyingBubble
 Bubble flying in the field.
bool _bubbleIsReady
 Interface is waiting for a command to fire the bubble.
BubbleGenerator_bubbleGenerator
 Bubble generator.
float _wallOffset
 Offset of the rear wall.
SoTranslation * _wallTranslation
 Translation of the rear wall.
float _wallSpeed
 Rear wall speed.
void(* _failedGameEndFunc )()
 Function that should be called on failed game end.

Static Private Attributes

static const float PLAY_BOX_SIDE_HALF_SIZE
 Half size of a single side of the play box.
static const float PLAY_BOX_DEPTH
 Depth of the play box.
static const float PLAY_BOX_NEAR_WALL_BOUND
 The near bound of the back wall.
static const float DEFAULT_WALL_OFFSET
 Default rear wall offset.


Detailed Description

Play field.

Reference object (cannot be copied).


Constructor & Destructor Documentation

PlayField::PlayField ( const PlayField  )  [private]

PlayField::PlayField ( const SceneConfiguration sceneConfig  ) 

Constructor.

Parameters:
[in] sceneConfig Scene configuration.

PlayField::~PlayField (  ) 

Destructor.


Member Function Documentation

PlayField& PlayField::operator= ( const PlayField  )  [private]

void PlayField::createNewBubble (  )  [private]

Adds non moving bubble which can be fired.

SbVec3f PlayField::coordsInBubbleField ( const SbVec3f &  pfCoords  )  [private]

Translates coordinates from play field system to bubble field system.

Parameters:
[in] pfCoords Coordinates in play field
Returns:
Returns coordinations in bubble field coordinations system

virtual void PlayField::timeUpdate ( float  dt  )  [virtual]

Timer value change event occured.

This method is called on each timer value change.

Parameters:
[in] dt Time difference between the last call (delta).

Implements TimeUpdateable.

virtual void PlayField::callableBackNotify ( BubbleField subject  )  [virtual]

Subject performed action on which the callback was defined.

Parameters:
[in] subject Object that perfmored the action.

Implements Templates::CallableBack< BubbleField >.

virtual void PlayField::callableBackNotify ( Avatar subject  )  [virtual]

Subject performed action on which the callback was defined.

Parameters:
[in] subject Object that perfmored the action.

Implements Templates::CallableBack< Avatar >.

void PlayField::fire (  ) 

Shoot a bubble.

void PlayField::launchBubble (  ) 

This method is called when the bubble should be really fired.

This method is used to delay launch of the bubble after fire() method was called in order to allow some graphical magic.

static float PlayField::getSizeHalfSize (  )  [inline, static]

Returns half size of a single side of the play box.

References PLAY_BOX_SIDE_HALF_SIZE.

Referenced by Bubble::getRadius().

static float PlayField::getDepth (  )  [inline, static]

Returns the depth of the play box.

References PLAY_BOX_DEPTH.

static float PlayField::getNearWallBound (  )  [inline, static]

Returns the near bound of the back wall.

References PLAY_BOX_NEAR_WALL_BOUND.


Member Data Documentation

const float PlayField::PLAY_BOX_SIDE_HALF_SIZE [static, private]

Half size of a single side of the play box.

Referenced by getSizeHalfSize().

const float PlayField::PLAY_BOX_DEPTH [static, private]

Depth of the play box.

Referenced by getDepth().

const float PlayField::PLAY_BOX_NEAR_WALL_BOUND [static, private]

The near bound of the back wall.

Referenced by getNearWallBound().

const float PlayField::DEFAULT_WALL_OFFSET [static, private]

Default rear wall offset.

Strategy object that encapsulates an algorithm rendering the play field.

Strategy object that encapsulates an algorithm in charge of physics.

Graphical representation of the player (the avatar).

"Glued-on" bubbles on the rear wall

Bubble flying in the field.

bool PlayField::_bubbleIsReady [private]

Interface is waiting for a command to fire the bubble.

Bubble generator.

float PlayField::_wallOffset [private]

Offset of the rear wall.

SoTranslation* PlayField::_wallTranslation [private]

Translation of the rear wall.

float PlayField::_wallSpeed [private]

Rear wall speed.

void(* PlayField::_failedGameEndFunc)() [private]

Function that should be called on failed game end.


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

Generated on Sat Dec 20 19:21:24 2008 for PGR2008 by  doxygen 1.5.6