Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 2, 2012, 10:34:48 PM (12 years ago)
Author:
landauf
Message:

cleaned up new SpaceRace classes (no functional code-changes):

  • formatting
  • naming of variables, arguments, functions
  • unused and duplicate code
  • public member variables
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/gametypes/RaceCheckPoint.h

    r9016 r9260  
    3131
    3232#include "gametypes/GametypesPrereqs.h"
    33 
    34 
    35 
    3633#include "objects/triggers/DistanceMultiTrigger.h"
    3734#include "interfaces/RadarViewable.h"
     
    4239    @brief
    4340        The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
    44          Don't forget to control the indexes of your check points and to set one last check point
     41        Don't forget to control the indexes of your check points and to set one last check point
    4542    */
    4643    class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
     
    5148
    5249            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    53             virtual void tick(float dt);
     50
    5451            inline void setCheckpointIndex(int checkpointIndex)
    55                 { this->bCheckpointIndex_ = checkpointIndex; }
    56             inline int getCheckpointIndex()
    57                 { return this->bCheckpointIndex_; }
     52                { this->checkpointIndex_ = checkpointIndex; }
     53            inline int getCheckpointIndex() const
     54                { return this->checkpointIndex_; }
    5855
    5956            inline void setNextcheckpoint(const Vector3& checkpoints)
    60                 { this->nextcheckpoints_=checkpoints; }
     57                { this->nextcheckpoints_ = checkpoints; }
    6158            inline void setNextcheckpoint(float x, float y, float z)
    6259                { this->setNextcheckpoint(Vector3(x, y, z)); }
    6360            inline const Vector3& getNextcheckpoint() const
    6461                { return this->nextcheckpoints_; }
     62
    6563            inline void setLast(bool isLast)
    6664                { this->bIsLast_ = isLast; }
    67             inline bool getLast()
     65            inline bool isLast() const
    6866                { return this->bIsLast_; }
    6967
    70             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.
    71             float bTimeLimit_; //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.
    72             PlayerInfo* reached_;
    73                
    74             inline float getTimeLimit()
    75                 { return this->bTimeLimit_; }
    76    
     68            virtual void setTimelimit(float timeLimit);
     69            inline float getTimeLimit() const
     70                { return this->timeLimit_; }
     71
     72            inline PlayerInfo* getPlayer() const
     73                { return this->player_; }
     74            inline void resetPlayer()
     75                { this->player_ = NULL; }
     76
    7777        protected:
    78             virtual void fire(bool bIsTriggered,BaseObject* player);
    79             virtual void setTimelimit(float timeLimit);
    80            
     78            virtual void fire(bool bIsTriggered, BaseObject* originator);
     79
    8180            inline const WorldEntity* getWorldEntity() const
    8281                { return this; }
    8382
    8483        private:
    85             int bCheckpointIndex_; //The index of this check point. The race starts with the check point with the index 0
    86             Vector3 nextcheckpoints_; //the indexes of the next check points
    87            
     84            int checkpointIndex_;     ///< The index of this check point. The race starts with the check point with the index 0
     85            Vector3 nextcheckpoints_; ///< the indexes of the next check points
     86            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.
     87            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.
     88            PlayerInfo* player_;      ///< The player that reached the checkpoint
    8889    };
    8990}
Note: See TracChangeset for help on using the changeset viewer.