Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 28, 2011, 11:19:02 AM (13 years ago)
Author:
dafrick
Message:

Gametype status notifications now working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel3/src/orxonox/infos/GametypeInfo.h

    r8453 r8634  
    6161            virtual ~GametypeInfo();
    6262
    63             virtual void changedActivity(void); // Is called when the activity has changed.
    64 
    6563            /**
    6664            @brief Get whether the game has started yet.
     
    103101            void changedCountdownCounter(void); // Is called when the start countdown counter has changed.
    104102
     103            /**
     104            @brief Get whether the local player is ready to spawn.
     105            @return Returns true if the player is ready to spawn, false if not.
     106            */
     107            inline bool isReadyToSpawn() const
     108                { return this->readyToSpawn_; }
     109            void changedReadyToSpawn(bool ready); // Inform the GametypeInfo that the local player has changed its spawned status.
     110           
     111            /**
     112            @brief Get whether the local player is spawned.
     113            @return Returns true if the local player is currently spawned, false if not.
     114            */
     115            inline bool isSpawned() const
     116                { return this->spawned_; }
     117            void changedSpawned(bool spawned); // Inform the GametypeInfo that the local player has changed its spawned status.
     118
    105119            inline const std::string& getHUDTemplate() const
    106120                { return this->hudtemplate_; }
     
    120134           
    121135        protected:
    122             void changedReadyToSpawn(PlayerInfo* player); // Is called when a player has become ready to spawn.
    123            
    124136            void start(void); // Inform the GametypeInfo that the game has started.
    125137            void end(void); // Inform the GametypeInfo that the game has ended.
     
    132144            void pawnKilled(PlayerInfo* player); // Inform the GametypeInfo about a player whose Pawn has been killed.
    133145            void playerSpawned(PlayerInfo* player); // Inform the GametypeInfo about a player that has spawned.
     146            void playerEntered(PlayerInfo* player); // Inform the GametypeInfo about a player that has entered,
    134147
    135148            inline void setHUDTemplate(const std::string& templateName)
     
    138151        private:
    139152            void registerVariables();
     153            void setSpawnedHelper(PlayerInfo* player, bool spawned); // Helper method. Sends changedReadyToSpawn notifiers over the network.
     154            void setReadyToSpawnHelper(PlayerInfo* player, bool ready); // Helper method. Sends changedSpawned notifiers over the network.
    140155
    141156            static const std::string NOTIFICATION_SENDER; //!< The name of the sender for the sending of notifications.
     
    148163            std::string hudtemplate_;
    149164           
    150             std::set<PlayerInfo*> spawned_; //!< A set of players that are currently spawned.
     165            std::set<PlayerInfo*> spawnedPlayers_; //!< A set of players that are currently spawned.
     166            bool spawned_; //!< Whether the local Player is currently spawned.
     167            bool readyToSpawn_; //!< Whether the local Player is ready to spawn.
    151168    };
    152169}
Note: See TracChangeset for help on using the changeset viewer.