/* base/racetrack.h This file is part of the Osirion project and is distributed under the terms and conditions of the GNU General Public License version 2 */ #ifndef __INCLUDED_BASE_RACETRACK_H__ #define __INCLUDED_BASE_RACETRACK_H__ #include "core/entity.h" #include "core/player.h" #include "math/mathlib.h" #include namespace game { class CheckPoint; /* ---- class RaceTrack -------------------------------------------- */ /// a race track entity class RaceTrack : public core::EntityDynamic { public: /// default constructor RaceTrack(); /// default destructor virtual ~RaceTrack(); /// list of racetrack checkpoints typedef std::list CheckPoints ; /// the player who activated the race inline core::Player *player() { return track_player; } /// add a checkpoint to the racetrack void add_checkpoint(CheckPoint *checkpoint); /// reset the race track void reset_race(); /// entity received a docking request virtual void func_dock(core::Entity *entity); /// run one time frame virtual void frame(const unsigned long elapsed); private: CheckPoints track_checkpoints; core::Player *track_player; float track_racestart; float track_checkpointtime; CheckPoints::iterator track_checkpoint; float track_record; }; /* ---- class CheckPoint ------------------------------------------- */ /// a checkpoint for the race track class CheckPoint : public core::EntityDynamic { public: CheckPoint(RaceTrack *parent); ~CheckPoint(); private: RaceTrack *parent_track; }; } #endif // __INCLUDED_BASE_NAVPOINT_H__