Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 9, 2011, 3:29:57 PM (13 years ago)
Author:
msalomon
Message:

Space Race gamtype with a clock and a set to save the time of the player.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spacerace/src/modules/gametypes/SpaceRace.h

    r8250 r8428  
    3434#include "RaceCheckPoint.h"
    3535#include <boost/concept_check.hpp>
     36#include <util/Clock.h>
     37#include <string.h>
     38#include <set>
    3639
    3740namespace orxonox
    3841{
     42/*    class PlayerScore {
     43        public:
     44            PlayerScore() {
     45                this->name = "";
     46                this->time =0;
     47            }
     48            PlayerScore(std::string name, float time) {
     49                this->name_ = name;
     50                this->time_ = time;
     51            }
     52            PlayerScore(float time) {
     53                this->name_ = "Player";
     54                this->time_ = time;
     55            }
     56       
     57        private:
     58            std::string name_;
     59            float time_;
     60    };*/
     61       
    3962    class _OrxonoxExport SpaceRace : public Gametype
    4063    {
    4164        public:
    4265            SpaceRace(BaseObject* creator);
    43             virtual ~SpaceRace(){};
     66            virtual ~SpaceRace() {}
    4467           
    4568            virtual void tick(float dt);
    4669           
    47             inline void newCheckpointReached()
    48                 { this->checkpointsReached_++; }
     70            virtual void start();
     71            virtual void end();
     72           
     73            virtual void newCheckpointReached();
     74           
    4975            inline void setCheckpointsReached(int n)
    5076                { this->checkpointsReached_ = n;}
     
    5682        private:
    5783            int checkpointsReached_;
     84            Clock *clock_;
     85            std::set<float> scores_;
     86           
    5887    };
    5988}
Note: See TracChangeset for help on using the changeset viewer.