Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Import()
- {
- _armyDeque.clear();
- _cost = 0;
- std::string line;
- std::ifstream myFile(_nationality.getName() + ".txt");
- int counter = 0;
- if (myFile.is_open())
- {
- while (getline(myFile, line))
- {
- if (counter == 1){ // line = armyName
- _name = line;
- _costLimit = 9999;
- }
- if (line == RomanUnits::Legionnaire::LegionnaireName){
- getline(myFile, line);
- AddUnit(new RomanUnits::Legionnaire(), std::stoi(line));
- }
- if (line == GaulUnits::Phalanx::PhalanxName){
- getline(myFile, line);
- AddUnit(new GaulUnits::Phalanx(), std::stoi(line));
- }
- if if if if if if if ...
- counter++;
- }
- myFile.close();
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement