Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

network: spawning ability added

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.