Changeset 2533
- Timestamp:
- Dec 23, 2008, 11:34:35 PM (16 years ago)
- Location:
- code/branches/bugger
- Files:
-
- 102 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/bugger
- Property svn:mergeinfo changed
/code/branches/lodfinal (added) merged: 2372,2380,2388,2394-2395,2402,2411
- Property svn:mergeinfo changed
-
code/branches/bugger/src/core/Template.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/core/Template.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/core/XMLFile.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/core/XMLIncludes.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/network/NetworkPrereqs.h
r2531 r2533 61 61 #include "util/Integers.h" 62 62 63 //----------------------------------------------------------------------- 64 // Library global contants 65 //----------------------------------------------------------------------- 66 namespace orxonox 67 { 68 static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1; 69 static const unsigned int CLIENTID_UNKNOWN = (unsigned int)-2; 70 static const uint32_t OBJECTID_UNKNOWN = (uint32_t)(-1); 71 } 63 72 64 73 //----------------------------------------------------------------------- … … 67 76 namespace orxonox 68 77 { 69 70 // Constants definition71 72 static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1;73 static const unsigned int CLIENTID_UNKNOWN = (unsigned int)-2;74 static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);75 static const unsigned int SCHED_PRIORITY_OFFSET = -5;76 77 78 79 80 78 class Client; 81 79 class ClientConnection; … … 103 101 class obj; 104 102 class objInfo; 105 namespace packet{ 103 104 namespace packet 105 { 106 106 class Gamestate; 107 107 class Packet; -
code/branches/bugger/src/network/Server.cc
r2171 r2533 63 63 { 64 64 const unsigned int MAX_FAILURES = 20; 65 const unsigned int NETWORK_FREQUENCY = 25;66 const float NETWORK_PERIOD = (float)1/NETWORK_FREQUENCY;67 65 68 66 /** -
code/branches/bugger/src/network/Server.h
r2171 r2533 52 52 { 53 53 const int CLIENTID_SERVER = 0; 54 const unsigned int NETWORK_FREQUENCY = 25; 55 const float NETWORK_PERIOD = 1./NETWORK_FREQUENCY; 54 56 55 57 /** -
code/branches/bugger/src/network/TrafficControl.cc
- Property svn:eol-style set to native
r2532 r2533 36 36 37 37 namespace orxonox { 38 39 static const unsigned int SCHED_PRIORITY_OFFSET = -1; 38 40 39 41 objInfo::objInfo(uint32_t ID, uint32_t creatorID, int32_t curGsID, int32_t diffGsID, uint32_t size, unsigned int prioperm, unsigned int priosched) … … 68 70 TrafficControl::TrafficControl() 69 71 { 70 Register RootObject(TrafficControl);72 RegisterObject(TrafficControl); 71 73 assert(instance_==0); 72 74 instance_=this; 73 // targetSize = 2500;//5000bytes 74 SetConfigValue ( targetSize, 28000./25. ); 75 this->setConfigValues(); 75 76 } 76 77 … … 79 80 */ 80 81 TrafficControl::~TrafficControl() 81 { 82 //was macht das genau? da instance ja gleich this ist im moment 82 { 83 83 instance_=0; 84 //muss ich alles deallozieren was ich im constructor aufgebaut habe?85 84 } 86 85 … … 89 88 */ 90 89 90 void TrafficControl::setConfigValues() 91 { 92 SetConfigValue ( bActive_, true ); 93 SetConfigValue ( targetSize, 5000 ); 94 } 95 91 96 /** 92 *eigener sortieralgorithmus97 * sort-algorithm for sorting the objectlist after priorities 93 98 */ 94 // bool TrafficControl::priodiffer(obj i, obj j) 95 // { 96 // std::map<unsigned int, objInfo>::iterator iti; 97 // std::map<unsigned int, objInfo>::iterator itj; 98 // iti=listToProcess_.find(i.objID); 99 // itj=listToProcess_.find(j.objID); 100 // return iti->second.objValuePerm < itj->second.objValuePerm; 101 // } 102 103 /** 104 * eigener sortieralgorithmus 105 */ 106 bool TrafficControl::priodiffer(uint32_t clientID, obj i, obj j) 99 bool TrafficControl::prioritySort(uint32_t clientID, obj i, obj j) 107 100 { 108 101 assert(clientListPerm_.find(clientID) != clientListPerm_.end()); //make sure the client exists in our list … … 112 105 int prio1 = clientListPerm_[clientID][i.objID].objValuePerm + clientListPerm_[clientID][i.objID].objValueSched; 113 106 int prio2 = clientListPerm_[clientID][j.objID].objValuePerm + clientListPerm_[clientID][j.objID].objValueSched; 114 // int prio1 = clientListPerm_[clientID][i.objID].objID;115 // int prio2 = clientListPerm_[clientID][j.objID].objID;116 // NOTE: smaller priority is better117 107 return prio1 < prio2; 118 108 } 119 109 110 /** 111 * sort-algorithm for sorting the objectList after position in original data stream 112 */ 113 bool TrafficControl::dataSort(obj i, obj j) 114 { 115 int pos1 = i.objDataOffset; 116 int pos2 = j.objDataOffset; 117 return pos1 < pos2; 118 } 119 120 120 121 121 122 void TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj> *list) … … 125 126 currentGamestateID=gamestateID; 126 127 evaluateList(clientID, list); 127 //list hatte vorher ja vielmehr elemente, nach zuweisung nicht mehr... speicherplatz??128 // *list=copiedVector;129 //später wird copiedVector ja überschrieben, ist das ein problem für list-dh. für gamestatemanager?130 128 return; 131 129 } … … 169 167 *Definition of private members 170 168 */ 171 172 173 /** 174 *copyList gets list of Gamestate Manager and turns it to *listToProcess 175 */ 176 // void TrafficControl::copyList(std::list<obj> *list) 177 // { 178 // std::list<obj>::iterator itvec; 179 // for(itvec = (*list).begin(); itvec != (*list).end(); itvec++) 180 // { 181 // objInfo objectA; 182 // objectA.objCreatorID=(*itvec).objCreatorID; 183 // objectA.objSize = (*itvec).objSize; 184 // listToProcess_.insert(std::pair<currentClientID, map<(*itvec).objID,objectA>>);//unsicher: ob map<...> so richtig ist 185 // } 186 // } 187 /** 188 *updateReferenceList compares the sent list by GSmanager with the current *reference list and updates it. 189 *returns void 190 */ 191 // void TrafficControl::updateReferenceList(std::map<unsigned int, objInfo> *list) 192 // { 193 // std::map<unsigned int, Synchronisable*>::iterator itref; 194 // std::map<unsigned int, objInfo>::iterator itproc; 195 // for(itproc=listToProcess_.begin(); itproc != listToProcess_.end(); itproc++) 196 // { 197 // //itproc->first=objectid that is looked for 198 // if(referenceList_->find(itproc->first)) 199 // { 200 // continue; 201 // } 202 // else 203 // { 204 // (*referenceList_).insert(pair<unsigned int, Synchronisable*>((*itproc).first,Synchronisable::getSynchronisable((*itproc).first)));//important: how to get adress of an object! 205 // insertinClientListPerm(currentClientID,itproc->first,itproc->second); 206 // } 207 // } 208 // } 169 209 170 /** 210 171 *updateClientListPerm … … 229 190 { 230 191 clientListTemp_[currentClientID][currentGamestateID] = std::list<obj>(*list); 231 // std::list<obj>::iterator itvec;232 // std::map<unsigned int,std::map<unsigned int, obj> >::iterator ittemp;233 // std::map<unsigned int, obj>::iterator ittempgs;234 // ittemp = clientListTemp_.find(currentClientID);235 // ittempgs = (*ittemp).find(currentGamestateID);236 // for(itvec = list.begin(); itvec!=list.end(), itvec++)237 // {238 // ittempgs.insert(itvec);static239 // }240 192 } 241 193 … … 252 204 { 253 205 assert( (*itvec).objSize < 1000); 254 // COUT(0) << "==targetsize== " << targetsize << endl;255 206 if ( ( size + (*itvec).objSize ) < targetsize ) 256 207 { 257 // COUT(0) << "no cut" << endl;258 208 size += (*itvec).objSize;//objSize is given in bytes 259 209 ++itvec; … … 261 211 else 262 212 { 263 // COUT(0) << "cut" << endl;264 213 clientListPerm_[currentClientID][(*itvec).objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative 265 // ittemp = itvec;266 214 list->erase(itvec++); 267 // itvec = ittemp;268 215 } 269 216 // printList(list, currentClientID); … … 278 225 void TrafficControl::evaluateList(unsigned int clientID, std::list<obj> *list) 279 226 { 280 //copyList(list);281 227 282 228 //now the sorting … … 284 230 //compare listToProcess vs clientListPerm 285 231 //if listToProcess contains new Objects, add them to clientListPerm 286 // std::map<unsigned int, objInfo>::iterator itproc;287 232 std::list<obj>::iterator itvec; 288 // std::map<unsigned int, std::map<unsigned int, objInfo> >::iterator itperm;289 // std::map<unsigned int, objInfo>::iterator itpermobj;290 233 for( itvec=list->begin(); itvec != list->end(); itvec++) 291 234 { 292 // itperm = clientListPerm_.find(clientID);293 235 if ( clientListPerm_[clientID].find( (*itvec).objID) != clientListPerm_[clientID].end() ) 294 236 { … … 296 238 //obj bleibt in liste und permanente prio wird berechnet 297 239 clientListPerm_[clientID][(*itvec).objID].objDiffGS = currentGamestateID - clientListPerm_[clientID][(*itvec).objID].objCurGS; 298 // ((*itpermobj).second).objDiffGS = ((*itpermobj).second).objCurGS - currentGamestateID;299 // permprio = clientListPerm_[clientID][(*itproc).first].objValuePerm;300 // itpermprio = (permObjPrio_).find((*itproc).first);301 // ((*itpermobj).second).objValuePerm = ((*itpermobj).second).objDiffGS * (*itpermprio).second;302 240 continue;//check next objId 303 241 } … … 306 244 // insert the object into clientListPerm 307 245 insertinClientListPerm(clientID,*itvec); 308 // itpermobj=(*itperm).find((*itproc).first)309 // ((*itpermobj).second).objDiffGS = ((*itpermobj).second).objCurGS - currentGamestateID;310 // itpermprio = (permObjPrio_).find((*itproc).first);311 // ((*itpermobj).second).objValuePerm = ((*itpermobj).second).objDiffGS * (*itpermprio).second;312 246 continue;//check next objId 313 247 } 314 248 } 315 249 //end compare listToProcess vs clientListPerm 316 317 //listToProc vs clientListTemp 318 //TODO: uncomment it again and change some things 319 /* 320 std::map<unsigned int, std::map<unsigned int, unsigned int> >::iterator ittemp; 321 std::map<unsigned int, unsigned int>::iterator ittempgs; 322 for( itproc=listToProcess_.begin(); itproc != listToProcess_.end();itproc++) 250 251 if( bActive_ ) 323 252 { 324 ittemp = clientListTemp_->find(currentClientID); 325 if( ittempgs = (*ittemp).find(currentGamestateID)) 326 { 327 if((*itproc).first == (*ittempgs).find((*itproc).first))//ja, dann ist objekt schon in der zu sendenden liste-muss nicht nochmal gesendet werden 328 { 329 (listToProcess_).erase (itproc); 330 } 331 else 332 continue; 333 } 334 else 335 continue; 336 }*/ 337 //end listToProc vs clientListTemp 338 339 //TODO: check whether we need this, cause i don't think so. 340 //listToProcess contains obj to send now, and since we give gsmanager the copiedlist and not listToProcess shorten copiedlist therefor too. 341 /*std::list<obj>::iterator itvec; 342 for(itvec = copiedVector.begin(); itvec != copiedVector.end(); itvec++) 343 { 344 if ( listToProcess_.find(itvec->objID) ) 345 { 346 continue;//therefore object wasnt thrown out yet and has to be sent back to gsmanager 347 } 348 else 349 { 350 copiedVector.remove(itvec); 351 } 352 }*/ 353 //sort copied list aufgrund der objprioperm in clientlistperm 354 // use boost bind here because we need to pass a memberfunction to stl sort 355 list->sort(boost::bind(&TrafficControl::priodiffer, this, clientID, _1, _2) ); 356 357 //now we check, that the creator of an object always exists on a client 358 // printList(list, clientID); 359 std::list<obj>::iterator itcreator; 360 for(itvec = list->begin(); itvec != list->end(); itvec++) 361 { 362 fixCreatorDependencies(itvec, list, clientID); 253 //sort copied list according to priorities 254 // use boost bind here because we need to pass a memberfunction to stl sort 255 list->sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) ); 256 257 //now we check, that the creator of an object always exists on a client 258 std::list<obj>::iterator itcreator; 259 for(itvec = list->begin(); itvec != list->end(); itvec++) 260 { 261 fixCreatorDependencies(itvec, list, clientID); 262 } 263 //end of sorting 264 //now the cutting, work the same obj out in processobjectlist and copiedlist, compression rate muss noch festgelegt werden. 265 // printList(list, clientID); 266 cut(list, targetSize); 267 268 //now sort again after objDataOffset 269 list->sort(boost::bind(&TrafficControl::dataSort, this, _1, _2) ); 363 270 } 364 //end of sorting365 //now the cutting, work the same obj out in processobjectlist and copiedlist, compression rate muss noch festgelegt werden.366 cut(list, targetSize);367 // printList(list, clientID);368 271 //diese Funktion updateClientList muss noch gemacht werden 369 272 updateClientListTemp(list); … … 398 301 } 399 302 } 400 401 402 /* 403 void bvlabla(list *a){ 404 //sort a 405 list *cache; 406 cache = new list<unsigned int>(*a); 407 return a; 408 } 409 */ 303 304 void TrafficControl::clientDisconnected(unsigned int clientID) 305 { 306 assert(clientListTemp_.find(clientID) != clientListTemp_.end() ); 307 assert(clientListPerm_.find(clientID) != clientListPerm_.end() ); 308 clientListTemp_.erase(clientListTemp_.find(clientID)); 309 clientListPerm_.erase(clientListPerm_.find(clientID)); 310 } 410 311 411 312 -
code/branches/bugger/src/network/TrafficControl.h
- Property svn:eol-style set to native
r2532 r2533 38 38 #include "util/Integers.h" 39 39 #include "core/OrxonoxClass.h" 40 #include "network/ClientConnectionListener.h" 40 41 41 42 namespace orxonox { … … 79 80 * 80 81 */ 81 class TrafficControl : public OrxonoxClass{82 class TrafficControl : public ClientConnectionListener { 82 83 private: 83 84 … … 122 123 unsigned int currentClientID; 123 124 unsigned int targetSize; 125 bool bActive_; 124 126 /** 125 127 *copiedVector is a copy of the given Vector by the GSmanager, on this list all manipulations are performed … … 141 143 void evaluateList(unsigned int clientID, std::list<obj> *list);//done 142 144 void ack(unsigned int clientID, unsigned int gamestateID); // this function gets called when the server receives an ack from the client 145 146 //ClientConnectionListener functions 147 virtual void clientConnected(unsigned int clientID){}; 148 virtual void clientDisconnected(unsigned int clientID); 143 149 150 144 151 protected: 145 152 static TrafficControl *instance_; … … 154 161 *Elements of struct i are therefore: *list[i].objID 155 162 */ 163 void setConfigValues(); 156 164 static TrafficControl *getInstance(); 157 165 void processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>* list); //gets a pointer to the list (containing objectIDs) and sorts it … … 162 170 void deleteObject(unsigned int objectID); // this function gets called when an object has been deleted (in order to clean up lists and maps) 163 171 164 bool priodiffer(uint32_t clientID, obj i, obj j); 172 bool prioritySort(uint32_t clientID, obj i, obj j); 173 bool dataSort(obj i, obj j); 165 174 void printList(std::list<obj> *list, unsigned int clientID); 166 175 void fixCreatorDependencies(std::list<obj>::iterator it, std::list<obj> *list, unsigned int clientID); -
code/branches/bugger/src/network/packet/Gamestate.cc
r2532 r2533 349 349 Gamestate *gs = new Gamestate(gdata); 350 350 uint8_t *newdata = gdata + sizeof(GamestateHeader); 351 //uint8_t *origdata = GAMESTATE_START(data_);351 uint8_t *origdata = GAMESTATE_START(data_); 352 352 353 353 //copy the GamestateHeader … … 357 357 uint32_t objectOffset; 358 358 unsigned int objectsize, destsize=0; 359 Synchronisable *object; 359 // TODO: Why is this variable not used? 360 //Synchronisable *object; 360 361 361 362 //call TrafficControl … … 366 367 if((*it).objSize==0) 367 368 continue; 368 oldobjectheader = (synchronisableHeader*) (data_ + (*it).objDataOffset);369 oldobjectheader = (synchronisableHeader*)origdata; 369 370 newobjectheader = (synchronisableHeader*)newdata; 370 object = Synchronisable::getSynchronisable( (*it).objID );371 assert(object->objectID == oldobjectheader->objectID);371 // object = Synchronisable::getSynchronisable( (*it).objID ); 372 // assert(object->objectID == oldobjectheader->objectID); 372 373 objectsize = oldobjectheader->size; 373 *newobjectheader = *oldobjectheader;374 374 objectOffset=sizeof(synchronisableHeader); //skip the size and the availableData variables in the objectheader 375 if ( /*object->doSelection(HEADER->id)*/true ){ 375 if ( (*it).objID == oldobjectheader->objectID ){ 376 memcpy(newdata, origdata, objectsize); 376 377 assert(newobjectheader->dataAvailable==true); 377 memcpy(newdata+objectOffset, data_ + (*it).objDataOffset + objectOffset, objectsize-objectOffset);378 ++it; 378 379 }else{ 380 *newobjectheader = *oldobjectheader; 379 381 newobjectheader->dataAvailable=false; 380 382 memset(newdata+objectOffset, 0, objectsize-objectOffset); 381 assert(objectOffset==objectsize);382 383 } 383 384 newdata += objectsize; 385 origdata += objectsize; 384 386 destsize += objectsize; 385 387 // origdata += objectsize; 386 388 } 387 389 ((GamestateHeader*)gdata)->datasize = destsize; 390 assert(destsize==HEADER->datasize); 388 391 assert(destsize!=0); 389 392 return gs; -
code/branches/bugger/src/network/synchronisable/NetworkCallbackManager.cc
- Property svn:eol-style set to native
-
code/branches/bugger/src/network/synchronisable/NetworkCallbackManager.h
- Property svn:eol-style set to native
-
code/branches/bugger/src/network/synchronisable/Synchronisable.cc
r2531 r2533 66 66 RegisterRootObject(Synchronisable); 67 67 static uint32_t idCounter=0; 68 objectFrequency_=1;69 68 objectMode_=0x1; // by default do not send data to server 70 69 if ( !Host::running() || ( Host::running() && Host::isServer() ) ) … … 78 77 classID = static_cast<uint32_t>(-1); 79 78 80 81 //#ifndef NDEBUG 82 // ObjectList<Synchronisable>::iterator it; 83 // for(it = ObjectList<Synchronisable>::begin(); it!=ObjectList<Synchronisable>::end(); ++it){ 84 // if(!(*it==this || (it->objectID==OBJECTID_UNKNOWN && it->objectMode_==0x0))) 85 // { 86 // COUT(1) << "Assertion failed: *it==this || (it->objectID==OBJECTID_UNKNOWN && it->objectMode_==0x0)" << std::endl; 87 // COUT(1) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl; 88 // abort(); 89 // } 90 // } 91 //#endif 79 // set standard priority 80 this->setPriority( priority::normal ); 81 82 83 // get creator id 84 #ifndef NDEBUG 85 ObjectList<Synchronisable>::iterator it; 86 for(it = ObjectList<Synchronisable>::begin(); it!=ObjectList<Synchronisable>::end(); ++it){ 87 if( it->getObjectID()==this->objectID ) 88 if(!(*it==this || (it->objectID==OBJECTID_UNKNOWN && it->objectMode_==0x0))){ 89 COUT(1) << "Assertion failed: *it==this || (it->objectID==OBJECTID_UNKNOWN && it->objectMode_==0x0)" << std::endl; 90 COUT(1) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl; 91 abort(); 92 } 93 } 94 #endif 92 95 93 96 this->creatorID = OBJECTID_UNKNOWN; … … 177 180 { 178 181 mem += header->size; //.TODO: this suckz.... remove size from header 182 assert(0); 179 183 return 0; 180 184 } … … 360 364 //assert( (mode ^ objectMode_) != 0); 361 365 if(syncList.empty()){ 366 assert(0); 362 367 COUT(4) << "Synchronisable::updateData syncList is empty" << std::endl; 363 368 return false; -
code/branches/bugger/src/network/synchronisable/Synchronisable.h
r2531 r2533 61 61 }; 62 62 } 63 64 namespace priority{ 65 enum prio{ 66 very_high = -100, 67 high = -15, 68 normal = 0, 69 low = 15, 70 very_low = 100 71 }; 72 } 63 73 64 74 struct _NetworkExport synchronisableHeader{ … … 101 111 template <class T> void unregisterVariable(T& var); 102 112 void setObjectMode(uint8_t mode); 103 void set ObjectPriority(unsigned int freq){ objectFrequency_ = freq; }113 void setPriority(unsigned int freq){ objectFrequency_ = freq; } 104 114 105 115 -
code/branches/bugger/src/orxonox/CameraManager.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/CameraManager.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/OrxonoxPrereqs.h
r2530 r2533 103 103 class QuestHint; 104 104 class QuestItem; 105 class QuestListener; 105 106 class QuestManager; 106 107 class Rewardable; … … 186 187 class HUDHealthBar; 187 188 class InGameConsole; 189 class Notification; 190 class NotificationManager; 191 class NotificationQueue; 188 192 class OrxonoxOverlay; 189 193 class OverlayGroup; -
code/branches/bugger/src/orxonox/gamestates/GSDedicated.cc
r2212 r2533 38 38 #include "network/Server.h" 39 39 #include "objects/Tickable.h" 40 #include "util/Sleep.h" 40 41 41 42 const unsigned int DEFAULT_DEDICATED_SERVER_TICKRATE = 25; -
code/branches/bugger/src/orxonox/objects/Level.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/Level.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/pickup/Usable.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/quest/AddQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file AddQuest.cc 31 @brief 32 Implementation of the AddQuest class. 30 @file 31 @brief Implementation of the AddQuest class. 33 32 */ 34 33 … … 45 44 #include "Quest.h" 46 45 47 namespace orxonox {48 46 namespace orxonox 47 { 49 48 CreateFactory(AddQuest); 50 49 … … 109 108 } 110 109 111 COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player ." << std::endl;110 COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player: " << player << " ." << std::endl; 112 111 return true; 113 112 } -
code/branches/bugger/src/orxonox/objects/quest/AddQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file AddQuest.h 31 @brief 32 Definition of the AddQuest class. 30 @file 31 @brief Definition of the AddQuest class. 33 32 */ 34 33 … … 43 42 #include "ChangeQuestStatus.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 /** 48 47 @brief … … 58 57 { 59 58 public: 60 61 62 63 64 65 59 AddQuest(BaseObject* creator); 60 virtual ~AddQuest(); 61 62 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML. 63 64 virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect. 66 65 67 66 }; -
code/branches/bugger/src/orxonox/objects/quest/AddQuestHint.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file AddQuestHint.cc 31 @brief 32 Implementation of the AddQuestHint class. 30 @file 31 @brief Implementation of the AddQuestHint class. 33 32 */ 34 33 … … 44 43 #include "QuestHint.h" 45 44 46 namespace orxonox {47 45 namespace orxonox 46 { 48 47 CreateFactory(AddQuestHint); 49 48 … … 130 129 } 131 130 132 COUT(3) << "QuestHint {" << this->getHintId() << "} successfully added to player ." << std::endl;131 COUT(3) << "QuestHint {" << this->getHintId() << "} successfully added to player: " << player << " ." << std::endl; 133 132 return true; 134 133 -
code/branches/bugger/src/orxonox/objects/quest/AddQuestHint.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file AddQuestHint.h 31 @brief 32 Definition of the AddQuestHint class. 30 @file 31 @brief Definition of the AddQuestHint class. 33 32 */ 34 33 … … 42 41 #include "QuestEffect.h" 43 42 44 namespace orxonox {45 43 namespace orxonox 44 { 46 45 /** 47 46 @brief … … 73 72 inline const std::string & getHintId(void) const 74 73 { return this->hintId_; } 74 75 75 bool setHintId(const std::string & id); //!< Sets the id of the QuestHint. 76 76 -
code/branches/bugger/src/orxonox/objects/quest/AddReward.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file AddReward.cc 31 @brief 32 Implementation of the AddReward class. 30 @file 31 @brief Implementation of the AddReward class. 33 32 */ 34 33 … … 41 40 #include "Rewardable.h" 42 41 43 namespace orxonox {44 42 namespace orxonox 43 { 45 44 CreateFactory(AddReward); 46 45 … … 106 105 bool AddReward::invoke(PlayerInfo* player) 107 106 { 107 COUT(3) << "AddReward on player: " << player << " ." << std::endl; 108 108 109 bool check = true; 109 110 for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward ) … … 111 112 check = check && (*reward)->reward(player); 112 113 } 114 115 COUT(3) << "Rewardable successfully added to player." << player << " ." << std::endl; 113 116 114 117 return check; -
code/branches/bugger/src/orxonox/objects/quest/AddReward.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file AddReward.h 31 @brief 32 Definition of the AddReward class. 30 @file 31 @brief Definition of the AddReward class. 33 32 */ 34 33 … … 43 42 #include "QuestEffect.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 /** 48 47 @brief … … 78 77 inline void addRewardable(Rewardable* reward) 79 78 { this->rewards_.push_back(reward); } 79 80 80 const Rewardable* getRewardables(unsigned int index) const; //!< Returns the Rewardable object at the given index. 81 81 -
code/branches/bugger/src/orxonox/objects/quest/CMakeLists.txt
r2530 r2533 14 14 QuestHint.cc 15 15 QuestItem.cc 16 QuestListener.cc 16 17 QuestManager.cc 17 18 Rewardable.cc -
code/branches/bugger/src/orxonox/objects/quest/ChangeQuestStatus.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file ChangeQuestStatus.cc 31 @brief 32 Implementation of the ChangeQuestStatus class. 30 @file 31 @brief Implementation of the ChangeQuestStatus class. 33 32 */ 34 33 … … 40 39 #include "QuestItem.h" 41 40 42 namespace orxonox {43 41 namespace orxonox 42 { 44 43 /** 45 44 @brief -
code/branches/bugger/src/orxonox/objects/quest/ChangeQuestStatus.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file ChangeQuestStatus.h 31 @brief 32 Definition of the ChangeQuestStatus class. 30 @file 31 @brief Definition of the ChangeQuestStatus class. 33 32 */ 34 33 … … 43 42 #include "QuestEffect.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 /** 48 47 @brief … … 63 62 protected: 64 63 /** 65 66 64 @brief Returns the id of the Quest. 65 @return Returns the id of the Quest. 67 66 */ 68 67 inline const std::string & getQuestId(void) const -
code/branches/bugger/src/orxonox/objects/quest/CompleteQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file CompleteQuest.cc 31 @brief 32 Implementation of the CompleteQuest class. 30 @file 31 @brief Implementation of the CompleteQuest class. 33 32 */ 34 33 … … 43 42 #include "Quest.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 CreateFactory(CompleteQuest); 48 47 -
code/branches/bugger/src/orxonox/objects/quest/CompleteQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file CompleteQuest.h 31 @brief 32 Definition of the CompleteQuest class. 30 @file 31 @brief Definition of the CompleteQuest class. 33 32 */ 34 33 … … 43 42 #include "ChangeQuestStatus.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 /** 48 47 @brief -
code/branches/bugger/src/orxonox/objects/quest/FailQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file FailQuest.cc 31 @brief 32 Implementation of the FailQuest class. 30 @file 31 @brief Implementation of the FailQuest class. 33 32 */ 34 33 … … 43 42 #include "Quest.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 CreateFactory(FailQuest); 48 47 -
code/branches/bugger/src/orxonox/objects/quest/FailQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file FailQuest.h 31 @brief 32 Definition of the FailQuest class. 30 @file 31 @brief Definition of the FailQuest class. 33 32 */ 34 33 … … 43 42 #include "ChangeQuestStatus.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 /** 48 47 @brief -
code/branches/bugger/src/orxonox/objects/quest/GlobalQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file GlobalQuest.cc 31 @brief 32 Implementation of the GlobalQuest class. 30 @file 31 @brief Implementation of the GlobalQuest class. 33 32 */ 34 33 … … 38 37 #include "orxonox/objects/infos/PlayerInfo.h" 39 38 #include "core/CoreIncludes.h" 39 #include "core/Super.h" 40 40 #include "util/Exception.h" 41 41 42 42 #include "QuestEffect.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 CreateFactory(GlobalQuest); 47 47 … … 88 88 bool GlobalQuest::fail(PlayerInfo* player) 89 89 { 90 if( this->isFailable(player)) //!< Check whether the Quest can be failed.91 { 92 this->setStatus(player, questStatus::failed);93 94 //! Iterate through all players possessing this Quest.95 for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)96 {97 QuestEffect::invokeEffects(*it, this->getFailEffectList());98 }99 100 return true;101 }102 103 COUT(4) << "A non-completable quest was trying to be failed." << std::endl; 104 return false;90 if(!this->isFailable(player)) //!< Check whether the Quest can be failed. 91 { 92 COUT(4) << "A non-completable quest was trying to be failed." << std::endl; 93 return false; 94 } 95 96 Quest::fail(player); 97 98 //! Iterate through all players possessing this Quest. 99 for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++) 100 { 101 QuestEffect::invokeEffects(*it, this->getFailEffectList()); 102 } 103 104 return true; 105 105 } 106 106 … … 117 117 bool GlobalQuest::complete(PlayerInfo* player) 118 118 { 119 if( this->isCompletable(player)) //!< Check whether the Quest can be completed.120 { 121 this->setStatus(player, questStatus::completed);122 123 //! Iterate through all players possessing the Quest.124 for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)125 {126 QuestEffect::invokeEffects(*it, this->getCompleteEffectList());127 }128 129 QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.130 return true;131 }132 133 COUT(4) << "A non-completable quest was trying to be completed." << std::endl;134 return false;119 if(!this->isCompletable(player)) //!< Check whether the Quest can be completed. 120 { 121 COUT(4) << "A non-completable quest was trying to be completed." << std::endl; 122 return false; 123 } 124 125 //! Iterate through all players possessing the Quest. 126 for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++) 127 { 128 QuestEffect::invokeEffects(*it, this->getCompleteEffectList()); 129 } 130 131 Quest::complete(player); 132 133 QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest. 134 return true; 135 135 } 136 136 … … 207 207 } 208 208 209 return questStatus::inactive;209 return questStatus::inactive; 210 210 } 211 211 -
code/branches/bugger/src/orxonox/objects/quest/GlobalQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file GlobalQuest.h 31 @brief 32 Definition of the GlobalQuest class. 30 @file 31 @brief Definition of the GlobalQuest class. 33 32 */ 34 33 … … 44 43 #include "Quest.h" 45 44 46 namespace orxonox {47 45 namespace orxonox 46 { 48 47 /** 49 48 @brief … … 56 55 <QuestDescription title="Title" description="Description." /> //The description of the quest. 57 56 <subquests> 58 <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.59 ...60 <Quest id="questIdn" />61 </subquests>62 <hints>63 <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.64 ...65 <QuestHint id="hintIdn" />66 </hints>57 <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well. 58 ... 59 <Quest id="questIdn" /> 60 </subquests> 61 <hints> 62 <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those. 63 ... 64 <QuestHint id="hintIdn" /> 65 </hints> 67 66 <fail-effects> 68 67 <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is failed, see QuestEffect for the full XML representation. -
code/branches/bugger/src/orxonox/objects/quest/LocalQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file LocalQuest.cc 31 @brief 32 Implementation of the LocalQuest class. 30 @file 31 @brief Implementation of the LocalQuest class. 33 32 */ 34 33 … … 37 36 38 37 #include "core/CoreIncludes.h" 38 #include "core/Super.h" 39 39 #include "util/Exception.h" 40 40 … … 42 42 #include "QuestEffect.h" 43 43 44 namespace orxonox {45 44 namespace orxonox 45 { 46 46 CreateFactory(LocalQuest); 47 47 … … 86 86 bool LocalQuest::fail(PlayerInfo* player) 87 87 { 88 if(this->isFailable(player)) //!< Checks whether the quest can be failed. 89 { 90 this->setStatus(player, questStatus::failed); 91 QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects. 92 return true; 93 } 94 95 COUT(4) << "A non-failable quest was trying to be failed." << std::endl; 96 return false; 88 if(!this->isFailable(player)) //!< Checks whether the quest can be failed. 89 { 90 COUT(4) << "A non-failable quest was trying to be failed." << std::endl; 91 return false; 92 } 93 94 Quest::fail(player); 95 96 QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects. 97 return true; 97 98 } 98 99 … … 108 109 bool LocalQuest::complete(PlayerInfo* player) 109 110 { 110 if(this->isCompletable(player)) //!< Checks whether the Quest can be completed. 111 { 112 this->setStatus(player, questStatus::completed); 113 QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects. 114 return true; 115 } 116 117 COUT(4) << "A non-completable quest was trying to be completed." << std::endl; 118 return false; 111 if(!this->isCompletable(player)) //!< Checks whether the Quest can be completed. 112 { 113 COUT(4) << "A non-completable quest was trying to be completed." << std::endl; 114 return false; 115 } 116 117 Quest::complete(player); 118 119 QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects. 120 return true; 119 121 } 120 122 -
code/branches/bugger/src/orxonox/objects/quest/LocalQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file LocalQuest.h 31 @brief 32 Definition of the LocalQuest class. 30 @file 31 @brief Definition of the LocalQuest class. 33 32 */ 34 33 … … 44 43 #include "Quest.h" 45 44 46 namespace orxonox {47 45 namespace orxonox 46 { 48 47 /** 49 48 @brief … … 56 55 <QuestDescription title="Title" description="Description." /> //The description of the quest. 57 56 <subquests> 58 <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.59 ...60 <Quest id="questIdn" />61 </subquests>62 <hints>63 <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.64 ...65 <QuestHint id="hintIdn" />66 </hints>57 <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well. 58 ... 59 <Quest id="questIdn" /> 60 </subquests> 61 <hints> 62 <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those. 63 ... 64 <QuestHint id="hintIdn" /> 65 </hints> 67 66 <fail-effects> 68 67 <QuestEffect /> //A list of QuestEffects, invoked when the Quest is failed, see QuestEffect for the full XML representation. -
code/branches/bugger/src/orxonox/objects/quest/Quest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file Quest.cc 31 @brief 32 Implementation of the Quest class. 30 @file 31 @brief Implementation of the Quest class. 33 32 */ 34 33 … … 43 42 #include "QuestHint.h" 44 43 #include "QuestEffect.h" 45 46 namespace orxonox { 47 44 #include "QuestListener.h" 45 46 namespace orxonox 47 { 48 48 /** 49 49 @brief … … 363 363 return this->getStatus(player) == questStatus::completed; 364 364 } 365 366 /** 367 @brief 368 Fails the Quest for an input player. 369 @param player 370 The player. 371 @return 372 Returns true if the Quest could be failed, false if not. 373 */ 374 bool Quest::fail(PlayerInfo* player) 375 { 376 QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed. 377 this->setStatus(player, questStatus::failed); 378 379 COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl; 380 381 this->getDescription()->sendFailQuestNotification(); 382 return true; 383 } 384 385 /** 386 @brief 387 Completes the Quest for an input player. 388 @param player 389 The player. 390 @return 391 Returns true if the Quest could be completed, false if not. 392 */ 393 bool Quest::complete(PlayerInfo* player) 394 { 395 QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed. 396 this->setStatus(player, questStatus::completed); 397 398 COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl; 399 400 this->getDescription()->sendCompleteQuestNotification(); 401 return true; 402 } 365 403 366 404 /** … … 374 412 bool Quest::start(PlayerInfo* player) 375 413 { 376 if(this->isStartable(player)) //!< Checks whether the quest can be started. 377 { 378 this->setStatus(player, questStatus::active); 379 return true; 380 } 381 382 COUT(4) << "A non-startable quest was trying to be started." << std::endl; 383 return false; 414 if(!this->isStartable(player)) //!< Checks whether the quest can be started. 415 { 416 COUT(4) << "A non-startable quest was trying to be started." << std::endl; 417 return false; 418 } 419 420 COUT(4) << "Quest {" << this->getId() << "} is started for player: " << player << " ." <<std::endl; 421 422 QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active. 423 424 this->setStatus(player, questStatus::active); 425 426 this->getDescription()->sendAddQuestNotification(); 427 return true; 428 } 429 430 /** 431 @brief 432 Adds a QuestListener to the list of QuestListeners listening to this Quest. 433 @param listener 434 The QuestListener to be added. 435 @return 436 Returns true if successful, false if not. 437 */ 438 bool Quest::addListener(QuestListener* listener) 439 { 440 if(listener == NULL) 441 { 442 COUT(2) << "A NULL-QuestListener was trying to be added to a Quests listeners." << std::endl; 443 return false; 444 } 445 446 this->listeners_.push_back(listener); 447 return true; 384 448 } 385 449 -
code/branches/bugger/src/orxonox/objects/quest/Quest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file Quest.h 31 @brief 32 Definition of the Quest class. 33 34 The Quest is the parent class of LocalQuest and GlobalQuest. 30 @file 31 @brief Definition of the Quest class. 32 The Quest is the parent class of LocalQuest and GlobalQuest. 35 33 */ 36 34 … … 47 45 #include "QuestItem.h" 48 46 49 namespace questStatus47 namespace orxonox 50 48 { 49 namespace questStatus 50 { 51 51 52 //!Different states of a Quest.53 enum Enum54 {55 inactive,56 active,57 failed,58 completed59 };52 //!Different states of a Quest. 53 enum Enum 54 { 55 inactive, 56 active, 57 failed, 58 completed 59 }; 60 60 61 } 62 63 namespace orxonox { 61 } 64 62 65 63 /** … … 90 88 { return this->parentQuest_; } 91 89 92 /** 93 @brief Returns the list of subquests. 94 @return Returns a reference to the list of subquests of the quest. 95 */ 96 inline const std::list<Quest*> & getSubQuestList(void) const 97 { return this->subQuests_; } 98 99 /** 100 @brief Returns the list of all QuestHints of this Quest. 101 @return Returns a reference to the list of QuestHints of the Quest. 102 */ 103 inline const std::list<QuestHint*> & getHintsList(void) const 104 { return this->hints_; } 105 106 bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'. 107 bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'. 108 bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'. 109 bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'. 110 111 bool start(PlayerInfo* player); //!< Sets a Quest to active. 112 virtual bool fail(PlayerInfo* player) = 0; //!< Fails the Quest. 113 virtual bool complete(PlayerInfo* player) = 0; //!< Completes the Quest. 90 /** 91 @brief Returns the list of subquests. 92 @return Returns a reference to the list of subquests of the quest. 93 */ 94 inline const std::list<Quest*> & getSubQuestList(void) const 95 { return this->subQuests_; } 96 97 /** 98 @brief Returns the list of all QuestHints of this Quest. 99 @return Returns a reference to the list of QuestHints of the Quest. 100 */ 101 inline const std::list<QuestHint*> & getHintsList(void) const 102 { return this->hints_; } 103 104 bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'. 105 bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'. 106 bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'. 107 bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'. 108 109 bool start(PlayerInfo* player); //!< Sets a Quest to active. 110 virtual bool fail(PlayerInfo* player); //!< Fails the Quest. 111 virtual bool complete(PlayerInfo* player); //!< Completes the Quest. 112 113 bool addListener(QuestListener* listener); //!< Adds a QuestListener to the list of QuestListeners listening to this Quest. 114 114 115 115 protected: … … 131 131 { return this->failEffects_; } 132 132 133 134 135 136 137 133 /** 134 @brief Returns the list of complete QuestEffects. 135 @return Returns a reference to the list of complete QuestEffects. 136 */ 137 inline std::list<QuestEffect*> & getCompleteEffectList(void) 138 138 { return this->completeEffects_; } 139 139 … … 141 141 virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player. 142 142 143 private:143 private: 144 144 Quest* parentQuest_; //!< Pointer to the parentquest. 145 145 std::list<Quest*> subQuests_; //!< List of all the subquests. … … 149 149 std::list<QuestEffect*> failEffects_; //!< A list of all QuestEffects to be invoked, when the Quest has been failed. 150 150 std::list<QuestEffect*> completeEffects_; //!< A list of QuestEffects to be invoked, when the Quest has been completed. 151 152 std::list<QuestListener*> listeners_; //!< A list of QuestListeners, that listen to what exactly happens with this Quest. 151 153 152 154 bool setParentQuest(Quest* quest); //!< Sets the parentquest of the Quest. -
code/branches/bugger/src/orxonox/objects/quest/QuestDescription.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestDescription.cc 31 @brief 32 Implementation of the QuestDescription class. 30 @file 31 @brief Implementation of the QuestDescription class. 33 32 */ 34 33 … … 38 37 39 38 #include "core/CoreIncludes.h" 39 #include "orxonox/overlays/notifications/Notification.h" 40 40 41 namespace orxonox {42 41 namespace orxonox 42 { 43 43 CreateFactory(QuestDescription); 44 44 … … 74 74 XMLPortParam(QuestDescription, "title", setTitle, getTitle, xmlelement, mode); 75 75 XMLPortParam(QuestDescription, "description", setDescription, getDescription, xmlelement, mode); 76 XMLPortParam(QuestDescription, "failMessage", setFailMessage, getFailMessage, xmlelement, mode); 77 XMLPortParam(QuestDescription, "completeMessage", setCompleteMessage, getCompleteMessage, xmlelement, mode); 76 78 77 79 COUT(3) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl; 80 } 81 82 /** 83 @brief 84 This method is a helper for sending QuestDescriptions as Notifications. 85 @param item 86 The item the QuestDescription is for. 87 @param status 88 The status the QuestDescription us for. 89 @return 90 Returns true if successful. 91 */ 92 bool QuestDescription::notificationHelper(const std::string & item, const std::string & status) const 93 { 94 std::string message = ""; 95 std::string title = ""; 96 if(item == "hint") 97 { 98 title = "You received a hint: '" + this->title_ + "'"; 99 message = this->description_; 100 } 101 else if(item == "quest") 102 { 103 if(status == "start") 104 { 105 title = "You received a new quest: '" + this->title_ + "'"; 106 message = this->description_; 107 } 108 else if(status == "fail") 109 { 110 title = "You failed the quest: '" + this->title_ + "'"; 111 message = this->failMessage_; 112 } 113 else if(status == "complete") 114 { 115 title = "You successfully completed the quest: '" + this->title_ + "'"; 116 message = this->completeMessage_; 117 } 118 else 119 { 120 COUT(2) << "Bad input in notificationHelper, this should not be happening!" << std::endl; 121 return false; 122 } 123 } 124 else 125 { 126 COUT(2) << "Bad input in notificationHelper, this should not be happening!" << std::endl; 127 return false; 128 } 129 130 Notification* notification = new Notification(0, message, title, 30); 131 notification->send(); 132 return true; 78 133 } 79 134 -
code/branches/bugger/src/orxonox/objects/quest/QuestDescription.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestDescription.h 31 @brief 32 Definition of the QuestDescription class. 30 @file 31 @brief Definition of the QuestDescription class. 33 32 */ 34 33 … … 43 42 #include "core/XMLPort.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 /** 48 47 @brief … … 52 51 Creating a QuestDescription through XML goes as follows: 53 52 54 <QuestDescription title="Title" description="Description Text" />53 <QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" /> 55 54 @author 56 55 Damian 'Mozork' Frick 57 56 */ 58 class _OrxonoxExport QuestDescription : public BaseObject {59 57 class _OrxonoxExport QuestDescription : public BaseObject 58 { 60 59 public: 61 60 QuestDescription(BaseObject* creator); … … 64 63 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestDescription object through XML. 65 64 66 /**67 @brief Returns the title.68 @return Returns a string containing the title of the QuestDescription.69 */65 /** 66 @brief Returns the title. 67 @return Returns a string containing the title of the QuestDescription. 68 */ 70 69 inline const std::string & getTitle(void) const 71 70 { return this->title_; } 72 71 73 /**74 @brief Returns the description text.75 @return Returns a string containing the description text of the QuestDescription.76 */72 /** 73 @brief Returns the description text. 74 @return Returns a string containing the description text of the QuestDescription. 75 */ 77 76 inline const std::string & getDescription(void) const 78 77 { return this->description_; } 78 79 /** 80 @brief Returns the fail message. 81 @return Returns a string containing the fail message of the QuestDescription. 82 */ 83 inline const std::string & getFailMessage(void) const 84 { return this->failMessage_; } 85 86 /** 87 @brief Returns the complete message. 88 @return Returns a string containing the complete message of the QuestDescription. 89 */ 90 inline const std::string & getCompleteMessage(void) const 91 { return this->completeMessage_; } 92 93 /** 94 @brief Sends a Notification displaying that a QuestHint was added. 95 @return Returns true if successful. 96 */ 97 inline bool sendAddHintNotification(void) const 98 { return notificationHelper("hint", ""); } 99 100 /** 101 @brief Sends a Notification displaying that a Quest was added. 102 @return Returns true if successful. 103 */ 104 inline bool sendAddQuestNotification(void) const 105 { return notificationHelper("quest", "start"); } 106 107 /** 108 @brief Sends a Notification displaying that a Quest was failed. 109 @return Returns true if successful. 110 */ 111 inline bool sendFailQuestNotification(void) const 112 { return notificationHelper("quest", "fail"); } 113 114 /** 115 @brief Sends a Notification displaying that a Quest was completed. 116 @return Returns true if successful. 117 */ 118 inline bool sendCompleteQuestNotification(void) const 119 { return notificationHelper("quest", "complete"); } 79 120 80 121 private: 81 122 std::string title_; //!< The title. 82 123 std::string description_; //!< The description. 124 std::string failMessage_; //!< The message displayed when the Quest is failed. 125 std::string completeMessage_; //!< The message displayed when the Quest is completed. 126 127 bool notificationHelper(const std::string & item, const std::string & status) const; //!< Helper for sending QuestDescriptions as Notifications. 83 128 84 129 /** … … 89 134 { this->title_ = title; } 90 135 91 /**136 /** 92 137 @brief Sets the description text. 93 138 @param description The description text to be set. … … 96 141 { this->description_ = description; } 97 142 143 /** 144 @brief Sets the fail message. 145 @param message The fail message to be set. 146 */ 147 inline void setFailMessage(const std::string & message) 148 { this->failMessage_ = message; } 149 150 /** 151 @brief Sets the complete message. 152 @param message The complete message to be set. 153 */ 154 inline void setCompleteMessage(const std::string & message) 155 { this->completeMessage_ = message; } 156 98 157 }; 99 158 -
code/branches/bugger/src/orxonox/objects/quest/QuestEffect.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestEffect.cc 31 @brief 32 Implementation of the QuestEffect class. 30 @file 31 @brief Implementation of the QuestEffect class. 33 32 */ 34 33 … … 40 39 #include "orxonox/objects/infos/PlayerInfo.h" 41 40 42 namespace orxonox {43 41 namespace orxonox 42 { 44 43 /** 45 44 @brief … … 71 70 Returns false if there was an error, view console of log for further detail. 72 71 */ 73 bool QuestEffect::invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects)72 /*static*/ bool QuestEffect::invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects) 74 73 { 75 74 bool check = true; 75 76 COUT(4) << "Invoking QuestEffects on player: " << player << " ." << std::endl; 76 77 77 78 for (std::list<QuestEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++) -
code/branches/bugger/src/orxonox/objects/quest/QuestEffect.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestEffect.h 31 @brief 32 Definition of the QuestEffect class. 30 @file 31 @brief Definition of the QuestEffect class. 33 32 */ 34 33 … … 42 41 #include "core/BaseObject.h" 43 42 44 namespace orxonox {45 43 namespace orxonox 44 { 46 45 /** 47 46 @brief -
code/branches/bugger/src/orxonox/objects/quest/QuestEffectBeacon.cc
r2530 r2533 28 28 29 29 /** 30 @file QuestEffectBeacon.cc 31 @brief 32 Implementation of the QuestEffectBeacon class. 30 @file 31 @brief Implementation of the QuestEffectBeacon class. 33 32 */ 34 33 … … 46 45 #include "QuestEffect.h" 47 46 48 namespace orxonox {49 47 namespace orxonox 48 { 50 49 CreateFactory(QuestEffectBeacon); 51 50 … … 59 58 60 59 this->status_ = QuestEffectBeaconStatus::active; 61 this->times_ = INFINITE ;60 this->times_ = INFINITE_TIME; 62 61 } 63 62 … … 91 90 SUPER(QuestEffectBeacon, processEvent, event); 92 91 93 SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);92 SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger); 94 93 } 95 94 … … 145 144 this->decrementTimes(); //!< Decrement the number of times the beacon can be used. 146 145 return true; 147 }148 149 return false;146 } 147 148 return false; 150 149 } 151 150 … … 187 186 return false; 188 187 } 189 if(this->getTimes() == INFINITE ) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.188 if(this->getTimes() == INFINITE_TIME) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times. 190 189 { 191 190 return true; … … 193 192 194 193 this->times_ = this->times_ - 1; //!< Decrement number of times the QuestEffectBeacon can be executed. 195 if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.196 {194 if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0. 195 { 197 196 this->status_ = QuestEffectBeaconStatus::inactive; 198 }197 } 199 198 200 199 return true; … … 213 212 bool QuestEffectBeacon::setTimes(const int & n) 214 213 { 215 if(n < 0 && n != INFINITE )214 if(n < 0 && n != INFINITE_TIME) 216 215 { 217 216 return false; -
code/branches/bugger/src/orxonox/objects/quest/QuestEffectBeacon.h
r2530 r2533 28 28 29 29 /** 30 @file QuestEffectBeacon.h 31 @brief 32 Definition of the QuestEffectBeacon class. 30 @file 31 @brief Definition of the QuestEffectBeacon class. 33 32 */ 34 33 … … 40 39 #include "orxonox/objects/worldentities/PositionableEntity.h" 41 40 42 namespace QuestEffectBeaconStatus41 namespace orxonox 43 42 { 43 namespace QuestEffectBeaconStatus 44 { 44 45 45 //! The status of the beacon, can be either active or inactive.46 enum Enum47 {48 inactive,49 active50 };46 //! The status of the beacon, can be either active or inactive. 47 enum Enum 48 { 49 inactive, 50 active 51 }; 51 52 52 } 53 54 namespace orxonox { 53 } 55 54 56 55 /** … … 61 60 A QuestEffectBeacon can be inactive or active. 62 61 63 Creating a QuestEffectBeacon through XML goes as follows:64 65 <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times.62 Creating a QuestEffectBeacon through XML goes as follows: 63 64 <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times. 66 65 <effects> 67 66 <QuestEffect /> //A list of QuestEffects, invoked when the QuestEffectBeacon is executed, see QuestEffect for the full XML representation. … … 70 69 </effects> 71 70 <events> 72 <execute>73 <EventListener event=eventIdString />74 </execute>75 </events>76 <attached>77 <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.78 </attached>79 </QuestEffectBeacon>71 <execute> 72 <EventListener event=eventIdString /> 73 </execute> 74 </events> 75 <attached> 76 <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon. 77 </attached> 78 </QuestEffectBeacon> 80 79 @author 81 80 Damian 'Mozork' Frick … … 83 82 class _OrxonoxExport QuestEffectBeacon : public PositionableEntity 84 83 { 85 public:86 QuestEffectBeacon(BaseObject* creator);87 virtual ~QuestEffectBeacon();88 89 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.90 91 virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.92 93 bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.94 95 /**96 @brief Tests whether the QuestEffectBeacon is active.97 @return Returns true if the QuestEffectBeacon is active, fals if not.98 */99 inline bool isActive(void)100 { return this->status_ == QuestEffectBeaconStatus::active; }101 102 bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.103 104 protected:84 public: 85 QuestEffectBeacon(BaseObject* creator); 86 virtual ~QuestEffectBeacon(); 87 88 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML. 89 90 virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon. 91 92 bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon. 93 94 /** 95 @brief Tests whether the QuestEffectBeacon is active. 96 @return Returns true if the QuestEffectBeacon is active, fals if not. 97 */ 98 inline bool isActive(void) 99 { return this->status_ == QuestEffectBeaconStatus::active; } 100 101 bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon. 102 103 protected: 105 104 bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed. 106 105 … … 111 110 inline const int & getTimes(void) const 112 111 { return this->times_; } 113 112 114 113 private: 115 //static const int INFINITE = -1; //!< Constant to avoid using magic numbers.116 114 static const int INFINITE_TIME = -1; //!< Constant to avoid using magic numbers. 115 117 116 std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player. 118 117 int times_; //!< Number of times the beacon can be exectued. -
code/branches/bugger/src/orxonox/objects/quest/QuestHint.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestHint.cc 31 @brief 32 Implementation of the QuestHint class. 30 @file 31 @brief Implementation of the QuestHint class. 33 32 */ 34 33 … … 41 40 #include "orxonox/objects/infos/PlayerInfo.h" 42 41 #include "QuestManager.h" 42 #include "QuestDescription.h" 43 43 #include "Quest.h" 44 44 45 namespace orxonox {46 45 namespace orxonox 46 { 47 47 CreateFactory(QuestHint); 48 48 … … 122 122 { 123 123 this->playerStatus_[player] = questHintStatus::active; 124 125 this->getDescription()->sendAddHintNotification(); 124 126 return true; 125 127 } -
code/branches/bugger/src/orxonox/objects/quest/QuestHint.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestHint.h 31 @brief 32 Definition of the QuestHint class. 30 @file 31 @brief Definition of the QuestHint class. 33 32 */ 34 33 … … 44 43 #include "QuestItem.h" 45 44 46 namespace questHintStatus47 {48 49 //! The status of the hint.50 enum Enum51 {52 inactive,53 active54 };55 56 }57 58 45 namespace orxonox 59 46 { 47 namespace questHintStatus 48 { 49 50 //! The state of the hint. 51 enum Enum 52 { 53 inactive, 54 active 55 }; 56 57 } 60 58 61 59 /** … … 96 94 private: 97 95 Quest* quest_; //!< The Quest the QuestHint belongs to. 98 std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the stat us for each player, with the Player-pointer as key.96 std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the states for each player, with the Player-pointer as key. 99 97 100 98 }; -
code/branches/bugger/src/orxonox/objects/quest/QuestItem.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestItem.cc 31 @brief 32 Implementation of the QuestItem class. 30 @file 31 @brief Implementation of the QuestItem class. 33 32 */ 34 33 … … 40 39 #include "QuestDescription.h" 41 40 42 namespace orxonox {43 41 namespace orxonox 42 { 44 43 /** 45 44 @brief … … 99 98 @return 100 99 Returns true if the string is likely to be of the required form. 101 @todo102 Clarify form, more vigorous checks.103 100 */ 104 bool QuestItem::isId(const std::string & id)101 /*static*/ bool QuestItem::isId(const std::string & id) 105 102 { 106 103 return id.size() >= 32; -
code/branches/bugger/src/orxonox/objects/quest/QuestItem.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestItem.h 31 @brief 32 Definition of the QuestItem class. 33 34 The QuestItem is the parent class of Quest and QuestHint. 30 @file 31 @brief Definition of the QuestItem class. 32 The QuestItem is the parent class of Quest and QuestHint. 35 33 */ 36 34 … … 46 44 #include "core/XMLPort.h" 47 45 48 namespace orxonox { 49 50 46 namespace orxonox 47 { 51 48 /** 52 49 @brief … … 67 64 /** 68 65 @brief Returns the id of this QuestItem. 69 @return Returns the id of the QuestItem.66 @return Returns the id of the QuestItem. 70 67 */ 71 68 inline const std::string & getId(void) const 72 69 { return this->id_; } 73 /** 74 @brief Returns the QuestDescription of the QuestItem. 75 @return Returns a pointer to the QuestDescription object of the QuestItem. 76 */ 70 71 /** 72 @brief Returns the QuestDescription of the QuestItem. 73 @return Returns a pointer to the QuestDescription object of the QuestItem. 74 */ 77 75 inline const QuestDescription* getDescription(void) const 78 76 { return this->description_; } -
code/branches/bugger/src/orxonox/objects/quest/QuestManager.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestManager.cc 31 @brief 32 Implementation of the QuestManager class. 30 @file 31 @brief Implementation of the QuestManager class. 33 32 */ 34 33 … … 42 41 #include "QuestHint.h" 43 42 44 namespace orxonox {45 43 namespace orxonox 44 { 46 45 //! All Quests registered by their id's. 47 46 std::map<std::string, Quest*> QuestManager::questMap_s; … … 76 75 Returns true if successful, false if not. 77 76 */ 78 bool QuestManager::registerQuest(Quest* quest)77 /*static*/ bool QuestManager::registerQuest(Quest* quest) 79 78 { 80 79 if(quest == NULL) //!< Doh! Just as if there were actual quests behind NULL-pointers. … … 108 107 Returns true if successful, false if not. 109 108 */ 110 bool QuestManager::registerHint(QuestHint* hint)109 /*static*/ bool QuestManager::registerHint(QuestHint* hint) 111 110 { 112 111 if(hint == NULL) //!< Still not liking NULL-pointers. … … 142 141 Throws an exception if the given questId is invalid. 143 142 */ 144 Quest* QuestManager::findQuest(const std::string & questId)143 /*static*/ Quest* QuestManager::findQuest(const std::string & questId) 145 144 { 146 145 if(!QuestItem::isId(questId)) //!< Check vor validity of the given id. … … 176 175 Throws an exception if the given hintId is invalid. 177 176 */ 178 QuestHint* QuestManager::findHint(const std::string & hintId)177 /*static*/ QuestHint* QuestManager::findHint(const std::string & hintId) 179 178 { 180 179 if(!QuestItem::isId(hintId)) //!< Check vor validity of the given id. -
code/branches/bugger/src/orxonox/objects/quest/QuestManager.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file QuestManager.h 31 @brief 32 Definition of the QuestManager class. 30 @file 31 @brief Definition of the QuestManager class. 33 32 */ 34 33 … … 43 42 #include "core/BaseObject.h" 44 43 45 namespace orxonox {46 44 namespace orxonox 45 { 47 46 /** 48 47 @brief -
code/branches/bugger/src/orxonox/objects/quest/Rewardable.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file Rewardable.cc 31 @brief 32 Implementation of the Rewardable class. 30 @file 31 @brief Implementation of the Rewardable class. 33 32 */ 34 33 … … 38 37 #include "core/CoreIncludes.h" 39 38 40 namespace orxonox {41 39 namespace orxonox 40 { 42 41 /** 43 42 @brief -
code/branches/bugger/src/orxonox/objects/quest/Rewardable.h
- Property svn:mergeinfo changed (with no actual effect on merging)
r2531 r2533 28 28 29 29 /** 30 @file Rewardable.h 31 @brief 32 Definition of the Rewardable class. 30 @file 31 @brief Definition of the Rewardable class. 33 32 */ 34 33 … … 40 39 #include "core/BaseObject.h" 41 40 42 namespace orxonox {43 41 namespace orxonox 42 { 44 43 /** 45 44 @brief … … 52 51 class _OrxonoxExport Rewardable : public BaseObject 53 52 { 54 55 53 public: 56 54 Rewardable(BaseObject* creator); … … 61 59 Method to transcribe a rewardable object to the player. 62 60 Must be implemented by every class inheriting from Rewardable. 63 @param player61 @param player 64 62 A pointer to the ControllableEntity, do whatever you want with it. 65 @return63 @return 66 64 Return true if successful. 67 65 */ 68 virtual bool reward(PlayerInfo* player) = 0; //!<66 virtual bool reward(PlayerInfo* player) = 0; 69 67 70 68 }; -
code/branches/bugger/src/orxonox/objects/weaponSystem/WeaponSystem.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/weaponSystem/WeaponSystem.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/Backlight.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/Backlight.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/CMakeLists.txt
r2414 r2533 16 16 ParticleEmitter.cc 17 17 ParticleSpawner.cc 18 Planet.cc 18 19 SpawnPoint.cc 19 20 ) -
code/branches/bugger/src/orxonox/objects/worldentities/Camera.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/Camera.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/ControllableEntity.cc
r2531 r2533 80 80 this->server_orientation_ = Quaternion::IDENTITY; 81 81 this->client_orientation_ = Quaternion::IDENTITY; 82 83 this->setPriority( priority::very_high ); 82 84 83 85 this->setConfigValues(); -
code/branches/bugger/src/orxonox/objects/worldentities/Model.cc
r2531 r2533 40 40 Model::Model(BaseObject* creator) : PositionableEntity(creator) 41 41 { 42 static unsigned int i=10;43 42 RegisterObject(Model); 44 43 … … 46 45 47 46 this->registerVariables(); 48 this->setObjectPriority(i++);49 47 } 50 48 -
code/branches/bugger/src/orxonox/objects/worldentities/MovableEntity.cc
r2531 r2533 52 52 this->overwrite_position_ = Vector3::ZERO; 53 53 this->overwrite_orientation_ = Quaternion::IDENTITY; 54 55 this->setPriority( priority::low ); 54 56 55 57 this->registerVariables(); -
code/branches/bugger/src/orxonox/objects/worldentities/ParticleSpawner.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/ParticleSpawner.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/PositionableEntity.cc
r2531 r2533 38 38 { 39 39 RegisterObject(PositionableEntity); 40 41 this->setPriority( priority::very_low ); 40 42 41 43 this->registerVariables(); -
code/branches/bugger/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc
r2530 r2533 28 28 29 29 /** 30 @file PlayerTrigger.cc30 @file 31 31 @brief 32 32 Implementation of the PlayerTrigger class. 33 33 */ 34 34 … … 38 38 #include "core/CoreIncludes.h" 39 39 40 namespace orxonox {41 40 namespace orxonox 41 { 42 42 /** 43 43 @brief … … 47 47 { 48 48 RegisterObject(PlayerTrigger); 49 49 50 50 this->player_ = NULL; 51 51 this->isForPlayer_ = true; 52 52 } 53 53 54 54 /** 55 55 @brief … … 66 66 void PlayerTrigger::XMLPort(Element& xmlelement, XMLPort::Mode mode) 67 67 { 68 68 SUPER(PlayerTrigger, XMLPort, xmlelement, mode); 69 69 } 70 71 70 } -
code/branches/bugger/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
r2530 r2533 28 28 29 29 /** 30 @file PlayerTrigger.h30 @file 31 31 @brief 32 32 Definition of the PlayerTrigger class. 33 33 */ 34 34 … … 40 40 #include "Trigger.h" 41 41 42 namespace orxonox {43 42 namespace orxonox 43 { 44 44 /** 45 45 @brief … … 50 50 class _OrxonoxExport PlayerTrigger : public Trigger 51 51 { 52 public: 53 PlayerTrigger(BaseObject* creator); 54 virtual ~PlayerTrigger(); 55 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML. 52 public: 53 PlayerTrigger(BaseObject* creator); 54 virtual ~PlayerTrigger(); 55 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML. 57 58 /** 59 @brief Returns the player that triggered the PlayerTrigger. 60 @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger. 61 */ 62 inline ControllableEntity* getTriggeringPlayer(void) const 63 { return this->player_; } 64 65 /** 66 @brief Checks whether the PlayerTrigger normally returns a ControllableEntity. 67 @return Returns true if the PlayerTrigger normally returns a ControllableEntity. 68 */ 69 inline bool isForPlayer(void) const 70 { return this->isForPlayer_; } 57 71 58 /** 59 @brief Returns the player that triggered the PlayerTrigger. 60 @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger. 61 */ 62 inline ControllableEntity* getTriggeringPlayer(void) const 63 { return this->player_; } 64 65 /** 66 @brief Checks whether the PlayerTrigger normally returns a ControllableEntity. 67 @return Returns true if the PlayerTrigger normally returns a ControllableEntity. 68 */ 69 inline bool isForPlayer(void) const 70 { return this->isForPlayer_; } 71 72 protected: 73 virtual bool isTriggered(TriggerMode mode) = 0; 74 75 /** 76 @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger. 77 @param player A pointer to the ControllableEntity that triggered the PlayerTrigger. 78 */ 79 inline void setTriggeringPlayer(ControllableEntity* player) 80 { this->player_ = player; } 72 protected: 73 virtual bool isTriggered(TriggerMode mode) = 0; 74 75 /** 76 @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger. 77 @param player A pointer to the ControllableEntity that triggered the PlayerTrigger. 78 */ 79 inline void setTriggeringPlayer(ControllableEntity* player) 80 { this->player_ = player; } 81 81 82 82 /** … … 84 84 @param isForPlayer Should be true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities, false if not. 85 85 */ 86 87 88 89 90 91 92 86 inline void setForPlayer(bool isForPlayer) 87 { this->isForPlayer_ = isForPlayer; } 88 89 private: 90 ControllableEntity* player_; //!< The player that triggered the PlayerTrigger. 91 bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities. 92 93 93 }; 94 94 -
code/branches/bugger/src/orxonox/objects/worldentities/triggers/Trigger.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/objects/worldentities/triggers/Trigger.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/orxonox/overlays/CMakeLists.txt
r2131 r2533 8 8 ADD_SOURCE_DIRECTORY(SRC_FILES debug) 9 9 ADD_SOURCE_DIRECTORY(SRC_FILES hud) 10 ADD_SOURCE_DIRECTORY(SRC_FILES notifications) 10 11 11 12 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/bugger/src/tolua/tolua-5.1.pkg
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/util
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/util/Exception.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/util/Exception.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/util/SignalHandler.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/src/util/SignalHandler.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/audio.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/base.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/ceguilua.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/core.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/cpptcl.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/debug.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/lua.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/network.vcproj
r2531 r2533 310 310 > 311 311 </File> 312 <File 313 RelativePath="..\..\src\network\TrafficControl.h" 314 > 315 </File> 312 316 <Filter 313 317 Name="packet" -
code/branches/bugger/visual_studio/vc8/network.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/orxonox.vcproj
r2530 r2533 305 305 </File> 306 306 <File 307 RelativePath="..\..\src\orxonox\objects\worldentities\Planet.cc" 308 > 309 </File> 310 <File 307 311 RelativePath="..\..\src\orxonox\objects\worldentities\PositionableEntity.cc" 308 312 > … … 625 629 </File> 626 630 <File 631 RelativePath="..\..\src\orxonox\objects\quest\QuestListener.cc" 632 > 633 </File> 634 <File 627 635 RelativePath="..\..\src\orxonox\objects\quest\QuestManager.cc" 628 636 > … … 799 807 </File> 800 808 </Filter> 809 <Filter 810 Name="notifications" 811 > 812 <File 813 RelativePath="..\..\src\orxonox\overlays\notifications\Notification.cc" 814 > 815 </File> 816 <File 817 RelativePath="..\..\src\orxonox\overlays\notifications\NotificationManager.cc" 818 > 819 </File> 820 <File 821 RelativePath="..\..\src\orxonox\overlays\notifications\NotificationQueue.cc" 822 > 823 </File> 824 </Filter> 801 825 </Filter> 802 826 <Filter … … 1005 1029 </File> 1006 1030 <File 1031 RelativePath="..\..\src\orxonox\objects\worldentities\Planet.h" 1032 > 1033 </File> 1034 <File 1007 1035 RelativePath="..\..\src\orxonox\objects\worldentities\PositionableEntity.h" 1008 1036 > … … 1044 1072 </File> 1045 1073 <File 1074 RelativePath="..\..\src\orxonox\objects\worldentities\triggers\PlayerTrigger.h" 1075 > 1076 </File> 1077 <File 1046 1078 RelativePath="..\..\src\orxonox\objects\worldentities\triggers\Trigger.h" 1047 1079 > … … 1153 1185 </File> 1154 1186 <File 1187 RelativePath="..\..\src\orxonox\objects\quest\QuestEffectBeacon.h" 1188 > 1189 </File> 1190 <File 1155 1191 RelativePath="..\..\src\orxonox\objects\quest\QuestHint.h" 1156 1192 > … … 1158 1194 <File 1159 1195 RelativePath="..\..\src\orxonox\objects\quest\QuestItem.h" 1196 > 1197 </File> 1198 <File 1199 RelativePath="..\..\src\orxonox\objects\quest\QuestListener.h" 1160 1200 > 1161 1201 </File> … … 1350 1390 <File 1351 1391 RelativePath="..\..\src\orxonox\overlays\debug\DebugRTRText.h" 1392 > 1393 </File> 1394 </Filter> 1395 <Filter 1396 Name="notifications" 1397 > 1398 <File 1399 RelativePath="..\..\src\orxonox\overlays\notifications\Notification.h" 1400 > 1401 </File> 1402 <File 1403 RelativePath="..\..\src\orxonox\overlays\notifications\NotificationManager.h" 1404 > 1405 </File> 1406 <File 1407 RelativePath="..\..\src\orxonox\overlays\notifications\NotificationQueue.h" 1352 1408 > 1353 1409 </File> -
code/branches/bugger/visual_studio/vc8/orxonox.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/orxonox_vc8.sln
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/release.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/tinyxml.vcproj
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/tinyxml.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/tolua.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/toluagen.vcproj
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/toluagen.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/toluagen_orxonox.vcproj
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/toluagen_orxonox.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/bugger/visual_studio/vc8/util.vsprops
- Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset
for help on using the changeset viewer.