Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

network: spawning ability added

File size: 1.6 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;
13
14//! The spawning point for world entities
15class SpawningPoint : public WorldEntity {
16
17  public:
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);
20    virtual ~SpawningPoint ();
21
22    void setSpawningEntity(int classID);
23    void setSpawningFrequency(float frequency);
24    void setPositionSeed(float seed);
25
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
33    void spawn();
34
35    virtual void tick(float dt);
36    virtual void draw();
37
38  private:
39    float                frequency;                      //!< the frequency for entity spawning
40    float                seed;                           //!< the random seed of the position
41    int                  classID;                        //!< the classid of the entity to spawn
42
43};
44
45#endif /* _SPAWNING_POINT */
Note: See TracBrowser for help on using the repository browser.