Changeset 10258 for code/trunk/src/orxonox
- Timestamp:
- Feb 5, 2015, 11:47:13 PM (10 years ago)
- Location:
- code/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/LevelManager.cc
r9667 r10258 89 89 SetConfigValue(defaultLevelName_, "missionOne.oxw") 90 90 .description("Sets the pre selection of the level in the main menu."); 91 SetConfigValue(lastFinishedCampaignMission_, "") 92 .description("The last finished mission of a campaign"); 93 SetConfigValue(campaignMissions_, std::vector<std::string>()) 94 .description("The list of missions in the campaign"); 95 } 96 97 /** 98 * @brief Stores the argument in the corresponding config value. 99 */ 100 void LevelManager::setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission) 101 { 102 ModifyConfigValue(lastFinishedCampaignMission_, set, lastFinishedCampaignMission); 91 103 } 92 104 -
code/trunk/src/orxonox/LevelManager.h
r9667 r10258 91 91 LevelInfoItem* getAvailableLevelListItem(unsigned int index); //!< Get the LevelInfoItem at the given index in the list of available Levels. 92 92 93 void setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission); 94 inline const std::string& getLastFinishedCampaignMission() const 95 { return this->lastFinishedCampaignMission_; } 96 97 inline unsigned int getNumberOfCampaignMissions() 98 { return this->campaignMissions_.size(); } 99 inline const std::string& getCampaignMission(unsigned int index) 100 { return this->campaignMissions_[index]; } 101 93 102 /** 94 103 @brief Get the instance of the LevelManager. … … 116 125 // config values 117 126 std::string defaultLevelName_; 127 std::string lastFinishedCampaignMission_; 128 std::vector<std::string> campaignMissions_; 118 129 119 130 static LevelManager* singletonPtr_s; -
code/trunk/src/orxonox/gametypes/Mission.cc
r9986 r10258 28 28 29 29 #include "Mission.h" 30 30 31 #include "items/Engine.h" 31 32 #include "controllers/ArtificialController.h" … … 36 37 #include "network/Host.h" 37 38 #include "worldentities/pawns/Pawn.h" 38 39 #include "LevelManager.h" 39 40 40 41 namespace orxonox … … 70 71 void Mission::pawnKilled(Pawn* victim, Pawn* killer) 71 72 { 72 if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer() 73 if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer()) 73 74 { 74 75 this->lives_--; … … 87 88 { 88 89 if (this->missionAccomplished_ && !this->gtinfo_->hasEnded()) 90 { 89 91 this->gtinfo_->sendAnnounceMessage("Mission accomplished!"); 92 93 LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename()); 94 } 90 95 else if (!this->gtinfo_->hasEnded()) 91 96 this->gtinfo_->sendAnnounceMessage("Mission failed!"); 97 92 98 Gametype::end(); 93 99 } 94 100 95 101 void Mission::setTeams() 96 { //Set pawn-colours102 { //Set pawn-colours 97 103 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 98 104 { 99 105 Pawn* pawn = static_cast<Pawn*>(*it); 100 if(!pawn) continue; 101 this->setDefaultObjectColour(pawn); 106 if (!pawn) 107 continue; 108 this->setDefaultObjectColour(pawn); 102 109 } 103 110 } … … 105 112 { 106 113 for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it) 107 { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!114 { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions! 108 115 it->setMissionAccomplished(accomplished); 109 116 it->end(); 110 117 } 111 118 } 112 119 113 120 void Mission::setLivesWrapper(unsigned int amount) 114 121 { 115 122 for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it) 116 { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!123 { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions! 117 124 it->setLives(amount); 118 125 } 119 126 } 120 121 122 127 }
Note: See TracChangeset
for help on using the changeset viewer.