Changeset 10182 for code/branches/presentationHS14/src
- Timestamp:
- Dec 15, 2014, 4:12:02 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS14/src/orxonox/gametypes/Mission.cc
r10175 r10182 81 81 void Mission::start() 82 82 { 83 std::fstream myfile;84 myfile.open("/home/pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt");85 std::string line;86 std::string mission=this->getFilename();87 int k=58-mission.length();88 std::string helperstring = "";89 if(myfile.is_open()){90 while (k>1) {91 helperstring=helperstring+" ";92 k=k-1;93 }94 helperstring=helperstring+".";95 while(getline (myfile,line)){96 if(line==mission+" 0"+helperstring){97 long pos = myfile.tellp();98 myfile.seekp (pos-61);99 myfile << mission+" 1"+helperstring;100 }101 }}102 else{103 this->end();104 }105 myfile.flush();106 myfile.clear();107 myfile.close();108 83 Gametype::start(); 109 84 this->setTeams(); … … 128 103 this->gtinfo_->sendAnnounceMessage("Mission accomplished!"); 129 104 std::fstream myfile; 130 myfile.open("/home/pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt"); 131 std::string line; 132 std::string mission=this->getFilename(); 133 int k=58-mission.length(); 134 std::string helperstring = ""; 135 if(myfile.is_open()){ 136 while (k>1) { 137 helperstring=helperstring+" "; 138 k=k-1; 139 } 140 helperstring=helperstring+"."; 141 while(getline (myfile,line)){ 142 if(line==mission+" 0"+helperstring){ 143 long pos = myfile.tellp(); 144 myfile.seekp (pos-61); 145 myfile << mission+" 1"+helperstring; 146 } 147 }} 148 myfile.flush(); 149 myfile.clear(); 150 myfile.close(); 151 } 105 myfile.open("/home/pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt"); 106 std::string line; 107 std::string mission=this->getFilename(); 108 int k=58-mission.length(); 109 std::string helperstring = ""; 110 if(myfile.is_open()){ 111 while (k>1) { 112 helperstring=helperstring+" "; 113 k=k-1; 114 } 115 helperstring=helperstring+"."; 116 while(getline (myfile,line)){ 117 if(line==mission+" 0"+helperstring){ 118 long pos = myfile.tellp(); 119 myfile.seekp (pos-61); 120 myfile << mission+" 1"+helperstring; 121 } 122 } 123 } 124 myfile.flush(); 125 myfile.clear(); 126 myfile.close(); 127 } 152 128 153 129 else if (!this->gtinfo_->hasEnded()) … … 171 147 if(accomplished){ 172 148 std::fstream myfile; 173 myfile.open("/home/ maxima/maxima-extra-0/orxonox/presentationHS14/data/gui/scripts/campaign.txt");149 myfile.open("/home/pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt"); 174 150 std::string line; 175 151 std::string mission=it->getFilename();
Note: See TracChangeset
for help on using the changeset viewer.