Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

network: loadparams for the spawning point

File size: 1.8 KB
Line 
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
12class World;
13class TiXmlElement;
14
15//! The spawning point for world entities
16class SpawningPoint : public WorldEntity {
17
18  public:
19    SpawningPoint (const Vector& absCoordinate = Vector(0.0, 0.0, 0.0), const World* world);
20    SpawningPoint (const Vector& position, float frequency, float seed, int classID, const World* world);
21    virtual ~SpawningPoint ();
22
23    void loadParams(const TiXmlElement* root);
24
25    void setSpawningEntity(int classID);
26    void setSpawningFrequency(float frequency);
27    void setPositionSeed(float seed);
28
29    /**  sets the entity that is going to be spawned by this point @param classID: the id from the class_id.h file */
30    void SpawningPoint::setSpawningEntity(int classID) { this->classID = classID; }
31    /** sets the frequency with which the point is going to spawn entities (1/sec) @param frequency: the frequency */
32    void SpawningPoint::setSpawningFrequency(float frequency) { this->frequency = frequency; }
33    /**  sets the seed of the position vector @param seed: the random seed around the given vector */
34    void SpawningPoint::setPositionSeed(float seed) { this->seed = seed; }
35
36    void spawn();
37
38    virtual void tick(float dt);
39    virtual void draw();
40
41  private:
42    float                frequency;                      //!< the frequency for entity spawning
43    float                countDown;                      //!< the timer that counts down until the next spawn
44    float                seed;                           //!< the random seed of the position
45    int                  classID;                        //!< the classid of the entity to spawn
46
47
48};
49
50#endif /* _SPAWNING_POINT */
Note: See TracBrowser for help on using the repository browser.