Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 19, 2013, 10:25:42 AM (11 years ago)
Author:
jo
Message:

Merging presentationHS12 back to the trunk.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/gametypes/RaceCheckPoint.h

    r9263 r9526  
    3737{
    3838    /**
    39     @brief
    40         The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
    41         Don't forget to control the indexes of your check points and to set one last check point
    42     */
    43     class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
     39     @brief
     40     The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
     41     Don't forget to control the indexes of your check points and to set one last check point
     42     */
     43    class _GametypesExport RaceCheckPoint: public DistanceMultiTrigger,
     44            public RadarViewable
    4445    {
    4546        public:
     
    5051
    5152            inline void setCheckpointIndex(int checkpointIndex)
    52                 { this->checkpointIndex_ = checkpointIndex; }
     53            {
     54                this->checkpointIndex_ = checkpointIndex;
     55            }
    5356            inline int getCheckpointIndex() const
    54                 { return this->checkpointIndex_; }
     57            {
     58                return this->checkpointIndex_;
     59            }
    5560
    5661            void setNextCheckpointsAsVector3(const Vector3& checkpoints);
    57             Vector3 getNextCheckpointsAsVector3() const;
    58             const std::set<int>& getNextCheckpoints() const
    59                 { return this->nextCheckpoints_; }
     62            Vector3 getNextCheckpointsAsVector3();
     63            Vector3 getVirtualNextCheckpointsAsVector3() const;
     64            void setNextVirtualCheckpointsAsVector3(const Vector3& checkpoints);
     65            int changeVirtualToRealCheckPoint(int);
    6066
     67            const std::set<int>& getVirtualNextCheckpoints() const
     68            {
     69                return this->nextCheckpointsVirtual_;
     70            }
     71
     72            const std::set<int>& getNextCheckpoints()
     73            {
     74                return nextCheckpoints_;
     75                std::set<int> temp;
     76                std::set<int> temp2=getVirtualNextCheckpoints();
     77                for (std::set<int>::iterator it = temp2.begin(); it!=temp2.end(); ++it){
     78                    temp.insert(changeVirtualToRealCheckPoint((*it)));
     79                }
     80                return temp;
     81            }
    6182            inline void setLast(bool isLast)
    62                 { this->bIsLast_ = isLast; }
     83            {
     84                this->bIsLast_ = isLast;
     85            }
    6386            inline bool isLast() const
    64                 { return this->bIsLast_; }
     87            {
     88                return this->bIsLast_;
     89            }
    6590
    6691            virtual void setTimelimit(float timeLimit);
    6792            inline float getTimeLimit() const
    68                 { return this->timeLimit_; }
     93            {
     94                return this->timeLimit_;
     95            }
    6996
    70             inline PlayerInfo* getPlayer() const
    71                 { return this->player_; }
     97            PlayerInfo* getPlayer(unsigned int clientID) const;
     98
     99            bool playerWasHere(PlayerInfo* ) const;
     100
    72101            inline void resetPlayer()
    73                 { this->player_ = NULL; }
     102            {
     103                this->players_.clear();
     104            }
    74105
    75106        protected:
     107
    76108            virtual void fire(bool bIsTriggered, BaseObject* originator);
    77109
    78110            inline const WorldEntity* getWorldEntity() const
    79                 { return this; }
     111            {
     112                return this;
     113            }
    80114
    81115        private:
    82             int checkpointIndex_;           ///< The index of this check point. The race starts with the check point with the index 0
     116
     117            int checkpointIndex_; ///< The index of this check point. The race starts with the check point with the index 0
    83118            std::set<int> nextCheckpoints_; ///< the indexes of the next check points
    84             bool bIsLast_;                  ///< True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
    85             float timeLimit_;               ///< The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
    86             PlayerInfo* player_;            ///< The player that reached the checkpoint
     119            bool bIsLast_; ///< True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
     120            float timeLimit_; ///< The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
     121            std::vector<PlayerInfo*> players_; ///< The player that reached the checkpoint
     122            Vector3 myPosition_;
     123            std::set<int>  nextCheckpointsVirtual_;
     124            std::map<int,int> virtualToRealCheckPoints_; // if virtualChepoint was inserted the original can be reconstructed
    87125    };
    88126}
Note: See TracChangeset for help on using the changeset viewer.