Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 20, 2012, 4:19:27 PM (13 years ago)
Author:
huttemat
Message:

changing xml files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/shipSelection/src/orxonox/LevelInfo.h

    r9057 r9101  
    4343
    4444#include "core/BaseObject.h"
     45#include <iostream>
     46#include <fstream>
    4547#include "core/OrxonoxClass.h"
    4648
     
    136138
    137139            inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export
     140            inline void selectShip (const std::string& ship) { this->changeShip(ship); } // tolua_export
     141
    138142
    139143        protected:
     
    148152
    149153        private:
     154            inline void changeShip (const std::string& model) {
     155                //HACK: Read Level XML File, find "shipselection", replace with ship model
     156                std::string text;
     157                std::ifstream myLevel ("test.txt");
     158                std::ofstream tempLevel ("test2.txt");
     159                while(!myLevel.eof())
     160                {
     161                        std::string buff;
     162                        std::getline(myLevel, buff);
     163                        tempLevel.write(buff.c_str(), buff.length());
     164                }
     165                myLevel.close();
     166                tempLevel.close();
     167                orxout(user_status) << "done" << endl;
     168            }
    150169            void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
    151170            void shipsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
Note: See TracChangeset for help on using the changeset viewer.