Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6992 in orxonox.OLD for trunk/src/story_entities/story_entity.cc


Ignore:
Timestamp:
Feb 2, 2006, 10:55:43 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: now the StoryEntity stores the path it was loaded with, not the GameWorld

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/story_entity.cc

    r6878 r6992  
    2222#include "story_entity.h"
    2323
     24#include "resource_manager.h"
    2425#include "load_param.h"
    2526
     
    3940  this->isRunning = false;
    4041
     42  this->loadFile = NULL;
    4143  this->storyID = -1;
    4244  this->description = NULL;
     
    6668      .describe("A Unique Identifier for this StoryEntity");
    6769
     70  LoadParam(root, "path", this, StoryEntity, setLoadFile)
     71      .describe("DEPRICATED FORM OF file. The Filename of this StoryEntity (relative from the data-dir)");
     72
     73  LoadParam(root, "file", this, StoryEntity, setLoadFile)
     74      .describe("The Filename of this StoryEntity (relative from the data-dir)");
     75
    6876  LoadParam(root, "nextid", this, StoryEntity, setNextStoryID)
    6977      .describe("Sets the ID of the next StoryEntity");
     
    8694
    8795/**
     96 *  sets the track path of this world
     97 * @param name the name of the path
     98 */
     99void StoryEntity::setLoadFile(const char* fileName)
     100{
     101  if (this->loadFile)
     102    delete this->loadFile;
     103  if (ResourceManager::isFile(fileName))
     104  {
     105    this->loadFile = new char[strlen(fileName)+1];
     106    strcpy(this->loadFile, fileName);
     107  }
     108  else
     109    this->loadFile = ResourceManager::getFullName(fileName);
     110}
     111
     112
     113/**
    88114 * sets the descroption of this StoryEntity
    89115 * @param name name
     
    101127}
    102128
     129/**
     130 * sets the id of the next story entity: StoryEntities can choose their following entity themselfs.
     131 * the entity id defined here  will be startet after this entity ends. this can be convenient if you
     132 * want to have a non linear story with switches.
     133 * @param nextStoryID the story id of the next StoryEntity
     134 */
     135void StoryEntity::setNextStoryID(int nextStoryID)
     136{
     137   this->nextStoryID = nextStoryID;
     138}
    103139
    104140/**
Note: See TracChangeset for help on using the changeset viewer.