[2636] | 1 | |
---|
| 2 | |
---|
| 3 | /* |
---|
| 4 | orxonox - the future of 3D-vertical-scrollers |
---|
| 5 | |
---|
| 6 | Copyright (C) 2004 orx |
---|
| 7 | |
---|
| 8 | This program is free software; you can redistribute it and/or modify |
---|
| 9 | it under the terms of the GNU General Public License as published by |
---|
| 10 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 11 | any later version. |
---|
| 12 | |
---|
| 13 | ### File Specific: |
---|
| 14 | main-programmer: Patrick Boenzli |
---|
| 15 | co-programmer: |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #include "story_entity.h" |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | using namespace std; |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | StoryEntity::StoryEntity () {} |
---|
| 27 | StoryEntity::~StoryEntity () {} |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | /** |
---|
[3221] | 31 | \brief sets the story ID |
---|
| 32 | |
---|
| 33 | sets the story id of the current entity, this enables it to be identified in a |
---|
| 34 | global context. |
---|
| 35 | */ |
---|
[3220] | 36 | void StoryEntity::setStoryID(int storyID) |
---|
[2636] | 37 | { |
---|
| 38 | this->storyID = storyID; |
---|
| 39 | } |
---|
| 40 | |
---|
[3221] | 41 | |
---|
| 42 | /** |
---|
| 43 | \brief this reads the story id of the current entity |
---|
| 44 | \returns the story entity id |
---|
| 45 | */ |
---|
[2636] | 46 | int StoryEntity::getStoryID() |
---|
| 47 | { |
---|
| 48 | return this->storyID; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | |
---|
[3221] | 52 | /** |
---|
| 53 | \brief sets the id of the next story entity |
---|
| 54 | |
---|
| 55 | StoryEntities can choose their following entity themselfs. the entity id defined here |
---|
| 56 | will be startet after this entity ends. this can be convenient if you want to have a |
---|
| 57 | non linear story with switches. |
---|
| 58 | */ |
---|
[3220] | 59 | void StoryEntity::setNextStoryID(int nextStoryID) |
---|
[2636] | 60 | { |
---|
| 61 | this->nextStoryID = nextStoryID; |
---|
| 62 | } |
---|
| 63 | |
---|
[3221] | 64 | /** |
---|
| 65 | \brief gets the story id of the current entity |
---|
| 66 | \returns story id |
---|
| 67 | */ |
---|
[3220] | 68 | int StoryEntity::getNextStoryID() |
---|
[2636] | 69 | { |
---|
| 70 | return this->nextStoryID; |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | |
---|
[3629] | 74 | /** |
---|
| 75 | \brief stuff that will have to be initialized before load |
---|
[3459] | 76 | |
---|
[3629] | 77 | this gives all storyentities the possibility to init stuff before the |
---|
| 78 | load function, where all the stuff is been made ready for start |
---|
[3459] | 79 | */ |
---|
[3629] | 80 | ErrorMessage StoryEntity::preLoad() |
---|
[3459] | 81 | {} |
---|
| 82 | |
---|
| 83 | /** |
---|
| 84 | \brief loads the current entity |
---|
| 85 | |
---|
| 86 | this is here to enable you loading maps into the entities. for all other actions you |
---|
| 87 | should take the init() function. |
---|
[3629] | 88 | load() is exec before init() |
---|
[3459] | 89 | */ |
---|
| 90 | ErrorMessage StoryEntity::load() |
---|
| 91 | {} |
---|
| 92 | |
---|
[3629] | 93 | |
---|
[3459] | 94 | /** |
---|
[3629] | 95 | \brief initialize the entity before use. |
---|
| 96 | \returns an error code if not able to apply. |
---|
| 97 | |
---|
| 98 | After execution of this function, the Entity is ready to be played/executed, |
---|
| 99 | this shifts the initialisation work before the execution - very important... |
---|
| 100 | init() is exec shortly before start() |
---|
| 101 | */ |
---|
| 102 | ErrorMessage StoryEntity::init() |
---|
| 103 | {} |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | /** |
---|
[3221] | 107 | \brief starts the entity with the choosen id. only for entities with lists. |
---|
| 108 | \param story id |
---|
| 109 | \returns error code if this action has caused a error |
---|
| 110 | |
---|
| 111 | this simply starts the story with the id storyID. the story with the choosen id has |
---|
| 112 | to be part of the current entity else, this doesn't make sense. this is used for |
---|
| 113 | campaigns or the GameLoader, they have lists of Campaigns/Worlds with their own |
---|
| 114 | storyID. |
---|
| 115 | */ |
---|
[3222] | 116 | ErrorMessage StoryEntity::start(int storyID) |
---|
[2636] | 117 | {} |
---|
| 118 | |
---|
[3221] | 119 | |
---|
| 120 | /** |
---|
| 121 | \brief starts the current entity |
---|
| 122 | \returns error code if this action has caused a error |
---|
| 123 | */ |
---|
[3222] | 124 | ErrorMessage StoryEntity::start() |
---|
[2636] | 125 | {} |
---|
| 126 | |
---|
[3221] | 127 | |
---|
| 128 | /** |
---|
| 129 | \brief pause the current entity |
---|
| 130 | \returns error code if this action has caused a error |
---|
| 131 | |
---|
| 132 | this pauses the current entity or passes this call forth to the running entity. |
---|
| 133 | */ |
---|
[3222] | 134 | ErrorMessage StoryEntity::pause() |
---|
[2636] | 135 | {} |
---|
| 136 | |
---|
[3221] | 137 | |
---|
| 138 | /** |
---|
| 139 | \brief resumes a pause |
---|
| 140 | \returns error code if this action has caused a error |
---|
| 141 | |
---|
| 142 | this resumess the current entity or passes this call forth to the running entity. |
---|
| 143 | */ |
---|
[3222] | 144 | ErrorMessage StoryEntity::resume() |
---|
[2636] | 145 | {} |
---|
| 146 | |
---|
| 147 | |
---|
[3221] | 148 | /** |
---|
[3459] | 149 | \brief stops the current entity |
---|
| 150 | \returns error code if this action has caused a error |
---|
[3221] | 151 | |
---|
[3459] | 152 | ATTENTION: this function shouldn't call other functions, or if so, they must return |
---|
| 153 | after finishing. If you ignore or forget to do so, the current entity is not able to |
---|
| 154 | terminate and it will run in the background or the ressources can't be freed or even |
---|
| 155 | worse: are freed and the program will end in a segmentation fault! |
---|
| 156 | hehehe, all seen... :) |
---|
[3221] | 157 | */ |
---|
[3459] | 158 | ErrorMessage StoryEntity::stop() |
---|
[2636] | 159 | {} |
---|
| 160 | |
---|
[3221] | 161 | |
---|
| 162 | /** |
---|
| 163 | \brief destroys and cleans up the current entity. |
---|
| 164 | |
---|
| 165 | this cleans up ressources before the deconstructor is called. for terminating |
---|
| 166 | the entity please use the stop() function. |
---|
| 167 | */ |
---|
[3459] | 168 | ErrorMessage StoryEntity::destroy() |
---|
[3220] | 169 | {} |
---|
[2636] | 170 | |
---|
[3220] | 171 | |
---|
[3221] | 172 | /** |
---|
| 173 | \brief this displays the load screen |
---|
| 174 | |
---|
| 175 | it will need some time to load maps or things like that. to inform the user about |
---|
| 176 | progress and to just show him/her something for the eyes, put here this stuff |
---|
| 177 | */ |
---|
[3220] | 178 | void StoryEntity::displayLoadScreen() |
---|
[2636] | 179 | {} |
---|
| 180 | |
---|
[3221] | 181 | |
---|
| 182 | /** |
---|
| 183 | \brief undisplay the load screen |
---|
| 184 | |
---|
| 185 | the load process has terminated, you now can release the load screen and start this |
---|
| 186 | entity. |
---|
| 187 | */ |
---|
[3220] | 188 | void StoryEntity::releaseLoadScreen() |
---|
[2636] | 189 | {} |
---|