Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/world_entities/spawning_point.h @ 6084

Last change on this file since 6084 was 6084, checked in by patrick, 18 years ago

network: spawning point coded, not yet tested

File size: 1.7 KB
RevLine 
[6080]1/*!
2 * @file spawning_point.h
3 *  Definition of a spawning point within the game, used for network game
4 */
5
6
7#ifndef _SPAWNING_POINT
8#define _SPAWNING_POINT
9
10#include "world_entity.h"
11
[6083]12class World;
13
[6080]14//! The spawning point for world entities
15class SpawningPoint : public WorldEntity {
16
17  public:
[6083]18    SpawningPoint (const Vector& absCoordinate = Vector(0.0, 0.0, 0.0), const World* world);
19    SpawningPoint (const Vector& position, float frequency, float seed, int classID, const World* world);
[6080]20    virtual ~SpawningPoint ();
21
[6081]22    void setSpawningEntity(int classID);
23    void setSpawningFrequency(float frequency);
24    void setPositionSeed(float seed);
[6080]25
[6081]26    /**  sets the entity that is going to be spawned by this point @param classID: the id from the class_id.h file */
27    void SpawningPoint::setSpawningEntity(int classID) { this->classID = classID; }
28    /** sets the frequency with which the point is going to spawn entities (1/sec) @param frequency: the frequency */
29    void SpawningPoint::setSpawningFrequency(float frequency) { this->frequency = frequency; }
30    /**  sets the seed of the position vector @param seed: the random seed around the given vector */
31    void SpawningPoint::setPositionSeed(float seed) { this->seed = seed; }
32
[6080]33    void spawn();
34
35    virtual void tick(float dt);
36    virtual void draw();
37
38  private:
[6081]39    float                frequency;                      //!< the frequency for entity spawning
[6084]40    float                countDown;                      //!< the timer that counts down until the next spawn
[6081]41    float                seed;                           //!< the random seed of the position
42    int                  classID;                        //!< the classid of the entity to spawn
[6080]43
[6084]44
[6080]45};
46
47#endif /* _SPAWNING_POINT */
Note: See TracBrowser for help on using the repository browser.