- Timestamp:
- Oct 29, 2013, 8:56:38 PM (11 years ago)
- Location:
- code/trunk/src/orxonox/gametypes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/gametypes/Mission.cc
r9667 r9728 32 32 33 33 #include "core/CoreIncludes.h" 34 #include "core/command/ConsoleCommand.h" 34 35 #include "network/Host.h" 35 36 #include "worldentities/pawns/Pawn.h" … … 37 38 namespace orxonox 38 39 { 40 SetConsoleCommand("Mission", "endMission", &Mission::endMission); 39 41 RegisterUnloadableClass(Mission); 40 42 … … 78 80 { 79 81 Gametype::end(); 80 /*if (this->missionAccomplished_)82 if (this->missionAccomplished_) 81 83 this->gtinfo_->sendAnnounceMessage("Mission accomplished!"); 82 84 else 83 85 this->gtinfo_->sendAnnounceMessage("Mission failed!"); 84 */85 86 } 86 87 … … 94 95 } 95 96 } 96 97 void Mission::endMission(bool accomplished) 98 { 99 for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it) 100 {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions! 101 it->setMissionAccomplished(accomplished); 102 it->end(); 103 } 104 } 97 105 98 106 -
code/trunk/src/orxonox/gametypes/Mission.h
r9667 r9728 52 52 inline unsigned int getLives() 53 53 {return this->lives_;} 54 inline void setMissionAccomplished(bool acc) 55 {this->missionAccomplished_ = acc;} 56 static void endMission(bool accomplished); 54 57 55 58 protected: … … 57 60 bool missionAccomplished_; //<! indicates if player successfully finsihed the mission; 58 61 int lives_; //<! amount of player's lives <-> nr. of retries 62 //Make end() a callback function to the event "END" 63 //or create a console command. 59 64 60 65 };
Note: See TracChangeset
for help on using the changeset viewer.