Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6087 in orxonox.OLD for branches


Ignore:
Timestamp:
Dec 13, 2005, 1:38:05 PM (19 years ago)
Author:
patrick
Message:

network: loadparams extension

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

Legend:

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

    r6086 r6087  
    2323 */
    2424SpawningPoint::SpawningPoint (const Vector& absCoordinate, const World* world)
    25   : WorldEntity(absCoodrinate)
     25    : WorldEntity(absCoodrinate)
    2626{
    2727  this->world = world;
     
    3737SpawningPoint::SpawningPoint (const Vector& position, float frequency,
    3838                              float seed, int classID, const World* world)
    39   : WorldEntity(position)
     39    : WorldEntity(position)
    4040{
    4141  this->frequency = frequency;
     
    6060void SpawningPoint::loadParams(const TiXmlElement* root)
    6161{
    62   // Do the PNode loading stuff
    63   static_cast<PNode*>(this)->loadParams(root);
     62  /* let the world entity its stuff first */
     63  static_cast<WorldEntity*>(this)->loadParams(root);
    6464
    65   // Model Loading
    66   LoadParam(root, "model", this, WorldEntity, loadModel)
    67       .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)")
    68       .defaultValues(3, NULL, 1.0f, 0);
     65  /* now load the frequency */
     66  LoadParam(root, "frequency", this, SpawningPoint, setSpawningFrequency)
     67  .describe("sets the frequency of the spawning point")
     68  .defaultValues(1, 1.0f);
    6969
     70
     71  /* now load the seed */
     72  LoadParam(root, "randomseed", this, SpawningPoint, setPositionSeed)
     73      .describe("sets the random position seed (variance in the spawning location around the position)")
     74      .defaultValues(1, 0.0f);
     75
     76  /* now load the seed */
     77  LoadParam(root, "classid", this, SpawningPoint, setSpawningEntity)
     78      .describe("sets the random position seed (variance in the spawning location around the position)")
     79      .defaultValues(1, CL_WORLD_ENTITY);
    7080}
    7181
     
    7787{
    7888  PRINTF(5)("Spangingpoint creates a new Entity (id: %i, frequency: %f, seed: %f)\n", this->classID,
    79            this->frequency, this->seed);
     89            this->frequency, this->seed);
    8090  BaseObject* spawningEntity = Factory::fabricate(this->classID);
    8191  if( LIKELY(this->world != NULL))
  • branches/network/src/world_entities/spawning_point.h

    r6086 r6087  
    2323    void loadParams(const TiXmlElement* root);
    2424
    25     void setSpawningEntity(int classID);
    26     void setSpawningFrequency(float frequency);
    27     void setPositionSeed(float seed);
    28 
    2925    /**  sets the entity that is going to be spawned by this point @param classID: the id from the class_id.h file */
    3026    void SpawningPoint::setSpawningEntity(int classID) { this->classID = classID; }
Note: See TracChangeset for help on using the changeset viewer.