Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8915


Ignore:
Timestamp:
Nov 2, 2011, 2:51:40 PM (12 years ago)
Author:
eceline
Message:

Vektoren

Location:
code/branches/spaceraceTwo/src/modules/gametypes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc

    r8858 r8915  
    5555    RaceCheckPoint::~RaceCheckPoint()
    5656    {
     57         //if (this->isInitialized())
     58        {
     59            //for (size_t i = 0; i < this->nextcheckpoints_.size(); ++i)
     60              //  this->nextcheckpoints_[i]->destroy();
     61        }
     62        nextcheckpoints_.clear();
    5763    }
    5864
     
    7682        XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
    7783        XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
     84    //XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,std::vector<int>);
    7885    }
    7986
  • code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h

    r8767 r8915  
    5757            inline bool getLast()
    5858                { return this->bIsLast_; }
    59             inline void setCheckpointIndex(int checkpointIndex)
     59           
     60        inline void setCheckpointIndex(int checkpointIndex)
    6061                { this->bCheckpointIndex_ = checkpointIndex; }
    6162            inline int getCheckpointIndex()
    6263                { return this->bCheckpointIndex_; }
     64
     65        inline void setNextcheckpoint(std::vector<int> checkpoints)
     66                { this->nextcheckpoints_ = checkpoints; }
     67            inline std::vector<int> getNextcheckpoint()
     68                { return this->nextcheckpoints_; }
    6369            virtual void setTimelimit(float timeLimit);
    6470            inline float getTimeLimit()
     
    7177            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.
    7278            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.
     79
     80        std::vector<int> nextcheckpoints_; //the indexes of the next check points
    7381     
    7482    };
  • code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc

    r8911 r8915  
    135135    }
    136136
    137         void SpaceRace::tick(float dt)
    138         {SUPER(SpaceRace,tick,dt);
    139137       
    140        
    141                 //if(const_cast<GametypeInfo*>(this->getGametypeInfo())->isStartCountdownRunning()){
    142                 //const_cast<GametypeInfo*>(this->getGametypeInfo())->start();}
    143         }
    144138       
    145139
  • code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc

    r8911 r8915  
    4444    {
    4545        RegisterObject(SpaceRaceManager);
    46        
    47        
     46               
    4847    }
    4948
    50    
     49   SpaceRaceManager::~SpaceRaceManager()
     50    {
     51        if (this->isInitialized())
     52        {
     53            for (size_t i = 0; i < this->checkpoints_.size(); ++i)
     54                this->checkpoints_[i]->destroy();
     55        }
     56    }
     57   
     58     void SpaceRaceManager::addCheckpoint(RaceCheckPoint* checkpoint)
     59    {
     60        this->checkpoints_.push_back(checkpoint);
     61    }
     62
     63    RaceCheckPoint* SpaceRaceManager::getCheckpoint(unsigned int index) const
     64    {
     65        if (index < this->checkpoints_.size())
     66            return this->checkpoints_[index];
     67        else
     68            return 0;
     69    }
     70   
    5171     void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5272    {
  • code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h

    r8911 r8915  
    5555        public:
    5656            SpaceRaceManager(BaseObject* creator);
    57             virtual ~SpaceRaceManager() {}
     57            virtual ~SpaceRaceManager() ;
    5858
    5959           void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    6060
    61            
     61            void addCheckpoint(RaceCheckPoint* checkpoint);
     62            RaceCheckPoint* getCheckpoint(unsigned int index) const;
     63
    6264        void tick(float dt);
    6365        protected:
    6466               
    6567        private:
     68        std::vector<RaceCheckPoint*> checkpoints_;
    6669 };
    6770}
Note: See TracChangeset for help on using the changeset viewer.