Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6083 in orxonox.OLD for branches/network


Ignore:
Timestamp:
Dec 13, 2005, 11:31:50 AM (19 years ago)
Author:
patrick
Message:

network: spawning ability added

Location:
branches/network/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/spawning_point.cc

    r6081 r6083  
    2222 *  standard constructor
    2323 */
    24 SpawningPoint::SpawningPoint (const Vector& absCoordinate)
     24SpawningPoint::SpawningPoint (const Vector& absCoordinate, const World* world)
    2525{}
    2626
     
    2929 *  constructor
    3030 */
    31 SpawningPoint::SpawningPoint (const Vector& position, float frequency, float seed, int classID)
     31SpawningPoint::SpawningPoint (const Vector& position, float frequency,
     32                              float seed, int classID, const World* world)
     33  : WorldEntity(position)
    3234{
     35  this->frequency = frequency;
     36  this->seed = seed;
     37  this->classID = classID;
     38  this->world = world;
    3339}
    3440
     
    4551 */
    4652void SpawningPoint::spawn()
    47 {}
     53{
     54  PRINTF(5)("Spangingpoint creates a new Entity (id: %i, frequency: %f, seed: %f)\n", this->classID,
     55           this->frequency, this->seed);
     56  BaseObject* spawningEntity = Factory::fabricate(this->classID);
     57  if( LIKELY(this->world != NULL))
     58    this->world->spawn(dynamic_cast<WorldEntity*>(spawningEntity));
     59}
    4860
    4961
  • branches/network/src/world_entities/spawning_point.h

    r6081 r6083  
    1010#include "world_entity.h"
    1111
     12class World;
     13
    1214//! The spawning point for world entities
    1315class SpawningPoint : public WorldEntity {
    1416
    1517  public:
    16     SpawningPoint (const Vector& absCoordinate = Vector(0.0, 0.0, 0.0));
    17     SpawningPoint (const Vector& position, float frequency, float seed, int classID);
     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);
    1820    virtual ~SpawningPoint ();
    1921
Note: See TracChangeset for help on using the changeset viewer.