Changeset 6424 in orxonox.OLD for trunk/src/story_entities/story_entity.cc
- Timestamp:
- Jan 7, 2006, 11:07:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/story_entity.cc
r6153 r6424 17 17 18 18 19 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD 20 21 19 22 #include "story_entity.h" 23 24 #include "load_param.h" 20 25 21 26 … … 23 28 24 29 25 30 /** 31 * default constructor initializes all needed data 32 */ 26 33 StoryEntity::StoryEntity () 27 34 { 28 35 this->setClassID(CL_STORY_ENTITY, "StoryEntity"); 36 29 37 this->isInit = false; 30 this->readyToRun = false;31 38 this->isPaused = false; 32 this->isSuspended = false; 33 } 39 this->isRunning = false; 34 40 35 StoryEntity::~StoryEntity () {} 36 37 38 /** 39 * sets the story ID 40 41 sets the story id of the current entity, this enables it to be identified in a 42 global context. 43 */ 44 void StoryEntity::setStoryID(int storyID) 45 { 46 this->storyID = storyID; 41 this->storyID = -1; 42 this->nextStoryID = WORLD_ID_GAMEEND; 47 43 } 48 44 49 45 50 46 /** 51 * this reads the story id of the current entity 52 * @returns the story entity id 53 */ 54 int StoryEntity::getStoryID() 55 { 56 return this->storyID; 57 } 47 * deconstructor 48 */ 49 StoryEntity::~StoryEntity () 50 {} 58 51 59 52 60 53 /** 61 * sets the id of the next story entity 54 * loads the Parameters of a Campaign 55 * @param root: The XML-element to load from 56 */ 57 void StoryEntity::loadParams(const TiXmlElement* root) 58 { 59 static_cast<BaseObject*>(this)->loadParams(root); 62 60 63 StoryEntities can choose their following entity themselfs. the entity id defined here64 will be startet after this entity ends. this can be convenient if you want to have a65 non linear story with switches. 66 */ 67 void StoryEntity::setNextStoryID(int nextStoryID) 68 { 69 this->nextStoryID = nextStoryID;61 LoadParam(root, "identifier", this, StoryEntity, setStoryID) 62 .describe("A Unique Identifier for this StoryEntity"); 63 64 LoadParam(root, "nextid", this, StoryEntity, setNextStoryID) 65 .describe("Sets the ID of the next StoryEntity"); 66 67 PRINTF(4)("Loaded StoryEntity specific stuff\n"); 70 68 } 71 72 /**73 * gets the story id of the current entity74 * @returns story id75 */76 int StoryEntity::getNextStoryID()77 {78 return this->nextStoryID;79 }
Note: See TracChangeset
for help on using the changeset viewer.