Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 12, 2011, 12:31:23 AM (13 years ago)
Author:
dafrick
Message:

Merging tutoriallevel2 branch into tutoriallevel3 branch.

Location:
code/branches/tutoriallevel3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel3

  • code/branches/tutoriallevel3/src/orxonox/infos/GametypeInfo.h

    r7163 r8453  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    25  *      ...
     25 *      Damian 'Mozork' Frick
    2626 *
    2727 */
     28
     29/**
     30    @file GametypeInfo.h
     31    @brief Definition of the GametypeInfo class
     32*/
    2833
    2934#ifndef _GametypeInfo_H__
     
    3338
    3439#include <string>
     40
    3541#include "Info.h"
    3642
    3743namespace orxonox
    3844{
     45
     46    /**
     47    @brief
     48        The GametypeInfo class keeps track of the state of the game and provides facilities to inform the player about it.
     49
     50    @author
     51        Fabian 'x3n' Landau
     52    @author
     53        Damian 'Mozork' Frick
     54    */
    3955    class _OrxonoxExport GametypeInfo : public Info
    4056    {
     
    4561            virtual ~GametypeInfo();
    4662
     63            virtual void changedActivity(void); // Is called when the activity has changed.
     64
     65            /**
     66            @brief Get whether the game has started yet.
     67            @return Returns true if the game has started, false if not.
     68            */
    4769            inline bool hasStarted() const
    4870                { return this->bStarted_; }
     71            void changedStarted(void); // Is called when the game has changed to started.
     72           
     73            /**
     74            @brief Get whether the game has ended yet.
     75            @return Returns true if the game has ended, false if not.
     76            */
    4977            inline bool hasEnded() const
    5078                { return this->bEnded_; }
     79            void changedEnded(void); // Is called when the game has changed to ended.
    5180
     81            /**
     82            @brief Get whether the start countdown is currently running.
     83            @return Returns true if the countdown is running, false if not.
     84            */
    5285            inline bool isStartCountdownRunning() const
    5386                { return this->bStartCountdownRunning_; }
     87            void changedStartCountdownRunning(void); // Is called when the start countdown has been either started or stopped.
     88
     89            /**
     90            @brief Get the current value of the start countdown.
     91            @return Returns the current value of the start countdown.
     92            */
    5493            inline float getStartCountdown() const
    5594                { return this->startCountdown_; }
     95
     96            /**
     97            @brief Get the current start countdown counter.
     98                   The start countdown counter only has integer values that correspond to the actually displayed countdown.
     99            @return Returns the current integer countdown counter.
     100            */
     101            inline unsigned int getStartCountdownCounter() const
     102                { return this->counter_; }
     103            void changedCountdownCounter(void); // Is called when the start countdown counter has changed.
    56104
    57105            inline const std::string& getHUDTemplate() const
     
    70118            void dispatchStaticMessage(const std::string& message,const ColourValue& colour);
    71119            void dispatchFadingMessage(const std::string& message);
     120           
     121        protected:
     122            void changedReadyToSpawn(PlayerInfo* player); // Is called when a player has become ready to spawn.
     123           
     124            void start(void); // Inform the GametypeInfo that the game has started.
     125            void end(void); // Inform the GametypeInfo that the game has ended.
     126            void setStartCountdown(float countdown); // Set the start countdown to the input value.
     127            void countdownStartCountdown(float countDown); // Count down the start countdown by the specified value.
     128            void countDown(); // Count down the start countdown counter.
     129            void startStartCountdown(void); // Inform the GametypeInfo about the start of the start countdown.
     130            void stopStartCountdown(void); // Inform the GametypeInfo about the stop of the start countdown.
     131            void playerReadyToSpawn(PlayerInfo* player); // Inform the GametypeInfo about a player that is ready to spawn.
     132            void pawnKilled(PlayerInfo* player); // Inform the GametypeInfo about a player whose Pawn has been killed.
     133            void playerSpawned(PlayerInfo* player); // Inform the GametypeInfo about a player that has spawned.
     134
     135            inline void setHUDTemplate(const std::string& templateName)
     136                { this->hudtemplate_ = templateName; };
    72137
    73138        private:
    74139            void registerVariables();
    75140
    76             bool bStarted_;
    77             bool bEnded_;
    78             bool bStartCountdownRunning_;
    79             float startCountdown_;
     141            static const std::string NOTIFICATION_SENDER; //!< The name of the sender for the sending of notifications.
     142
     143            bool bStarted_; //!< Whether the game has started,
     144            bool bEnded_; //!< Whether the game has ended.
     145            bool bStartCountdownRunning_; //!< Whether the start countdown is running.
     146            float startCountdown_; //!< The current value of the start countdown.
     147            unsigned int counter_; //!< The current integer value of the start countdown, the start countdown counter.
    80148            std::string hudtemplate_;
     149           
     150            std::set<PlayerInfo*> spawned_; //!< A set of players that are currently spawned.
    81151    };
    82152}
Note: See TracChangeset for help on using the changeset viewer.