From: <eg...@us...> - 2007-05-17 08:50:23
|
Revision: 468 http://svn.sourceforge.net/opengate/?rev=468&view=rev Author: egore Date: 2007-05-17 01:50:14 -0700 (Thu, 17 May 2007) Log Message: ----------- Add simple documentation about the gamestate classes Modified Paths: -------------- branches/ogsector/src/DockedState.cpp branches/ogsector/src/DockedState.h branches/ogsector/src/GameState.h branches/ogsector/src/UnDockedState.h Modified: branches/ogsector/src/DockedState.cpp =================================================================== --- branches/ogsector/src/DockedState.cpp 2007-05-17 08:35:54 UTC (rev 467) +++ branches/ogsector/src/DockedState.cpp 2007-05-17 08:50:14 UTC (rev 468) @@ -44,7 +44,7 @@ namespace OpenGate{ -DockedState::DockedState(){ +DockedState::DockedState(){ sceneMgr_ = NULL; shipConfigDialog_ = NULL; } Modified: branches/ogsector/src/DockedState.h =================================================================== --- branches/ogsector/src/DockedState.h 2007-05-17 08:35:54 UTC (rev 467) +++ branches/ogsector/src/DockedState.h 2007-05-17 08:50:14 UTC (rev 468) @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef DOCKEDSTATELISTENER__H -#define DOCKEDSTATELISTENER__H +#ifndef _OPENGATE_DOCKEDSTATELISTENER__H +#define _OPENGATE_DOCKEDSTATELISTENER__H #include <OgreCamera.h> @@ -29,11 +29,20 @@ namespace OpenGate{ + +/*! + * \brief This class defines the gamestate the gamestate when the user is docked + * + * When a user is currently docked at a station, this gamestate is active. The + * user is not able to move his ship or to fire weapons. But he is able to trade + * things, chat with others, equip his ship, etc. + * \author Carsten <spo...@us...> + */ class DockedState : public GameState { public: DECLARE_GAMESTATE_CLASS( DockedState ); - + virtual void createContent( ); virtual void destroyContent( ); @@ -71,8 +80,8 @@ Ogre::SceneManager * sceneMgr_; ShipConfigDialog * shipConfigDialog_; -}; +}; } // namespace OpenGate -#endif // DOCKEDSTATELISTENER__H +#endif // _OPENGATE_DOCKEDSTATELISTENER__H Modified: branches/ogsector/src/GameState.h =================================================================== --- branches/ogsector/src/GameState.h 2007-05-17 08:35:54 UTC (rev 467) +++ branches/ogsector/src/GameState.h 2007-05-17 08:50:14 UTC (rev 468) @@ -31,7 +31,7 @@ #include "OgreCEGUIRenderer.h" #include "OgreCEGUIResourceProvider.h" //regular mem handler -#include <OgreMemoryMacros.h> +#include <OgreMemoryMacros.h> #include <OgreFrameListener.h> @@ -55,34 +55,44 @@ class GameStateListener { public: - /** Constructor */ + /*! Constructor */ GameStateListener( ){ }; - - /** Virtual Deconstructor */ + + /*! Virtual Deconstructor */ virtual ~GameStateListener( ){ }; - - /** Store a game state to manage. */ + + /*! Store a game state to manage. */ virtual void manageGameState( const std::string & stateName, GameState * state ) = 0; - + /*! Find a game state by name. @Remarks returns 0 on failure. */ virtual GameState * findByName( const std::string & stateName) = 0; - - /** Request a change to state. */ + + /*! Request a change to state. */ virtual void changeGameState( GameState * state ) = 0; - - /** Push state onto the stack. */ + + /*! Push state onto the stack. */ virtual bool pushGameState( GameState * state ) = 0; - - /** Pop a game state off the stack. */ + + /*! Pop a game state off the stack. */ virtual void popGameState() = 0; - - /** Cause a shutdown. */ + + /*! Cause a shutdown. */ virtual void shutdown() = 0; - - /** Start gamestate. */ + + /*! Start gamestate. */ virtual void start( GameState * state ) = 0; }; +/*! + * \brief This abstract class defines a gamestate + * + * A gamestate is, as the name might suggest, the state of the game. The game + * needs to know what a user is currently doing. I.e. it has to act different + * if the user flying through space or if the user is docked. In one "state" the + * mouse controlls the ship. In the other state the mouse can be used in the + * menu. The gamestate describes this. + * \author Carsten <spo...@us...> + */ class GameState : public Ogre::FrameListener, public OIS::KeyListener, public OIS::MouseListener, @@ -146,31 +156,31 @@ } protected: - /** Constructor: This should be a private member of an inherited class. */ + /*! Constructor: This should be a private member of an inherited class. */ GameState() {}; - /** Destructor: This should be a private member of an inherited class. */ + /*! Destructor: This should be a private member of an inherited class. */ virtual ~GameState( ) {}; - /** Find a state by its name. */ + /*! Find a state by its name. */ GameState * findByName( const std::string & stateName ) { return parent_->findByName( stateName ); } - /** Request a change to game state. */ + /*! Request a change to game state. */ void changeGameState( GameState *state ) { parent_->changeGameState( state ); } - /** Push game state onto the stack. */ + /*! Push game state onto the stack. */ bool pushGameState( GameState * state ) { return parent_->pushGameState( state ); } - /** Pop a game state off the stack. */ + /*! Pop a game state off the stack. */ void popGameState( void ) { parent_->popGameState(); } - /** Cause a shutdown. */ + /*! Cause a shutdown. */ void shutdown( void ) { parent_->shutdown(); } - - /** Stores the GameStateManager which is managing this state. */ + + /*! Stores the GameStateManager which is managing this state. */ GameStateListener * parent_; - /** Keeps a method of device interaction. */ + /*! Keeps a method of device interaction. */ DeviceInfo * devices_; LogManager * log_; }; Modified: branches/ogsector/src/UnDockedState.h =================================================================== --- branches/ogsector/src/UnDockedState.h 2007-05-17 08:35:54 UTC (rev 467) +++ branches/ogsector/src/UnDockedState.h 2007-05-17 08:50:14 UTC (rev 468) @@ -32,18 +32,20 @@ class Sector; +/*! + * \brief This class defines the gamestate the gamestate when the user is flying + * + * This gamestate is the opposite of the DockedState. The user is flying through + * space, he can shot his weapons, move his ship, etc. but not modify his ship. + * \author Carsten <spo...@us...> + */ class UnDockedState : public GameState{ - -// class UnDockedState: public Ogre::FrameListener, -// public OIS::KeyListener, -// public OIS::MouseListener, -// public OIS::JoyStickListener { public: DECLARE_GAMESTATE_CLASS( UnDockedState ); void createContent( ); - + void destroyContent( ); void enter(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |