~widelands-dev/widelands/trunk

« back to all changes in this revision

Viewing changes to src/logic/production_program.cc

  • Committer: fios at foramnagaidhlig
  • Date: 2014-07-29 22:01:31 UTC
  • mto: This revision was merged to the branch mainline in revision 7161.
  • Revision ID: fios@foramnagaidhlig.net-20140729220131-1syk3u5esbep57if
Changed ProductionSite char m_result_buffer[213] to private std::string          m_production_result and added getter/setters

Show diffs side-by-side

added added

removed removed

Lines of Context:
593
593
                                                                        % condition_string)
594
594
                                                                  .str();
595
595
                }
596
 
                ps.set_result_string(result_string.c_str());
 
596
                ps.set_production_result(result_string);
597
597
        }
598
598
        return ps.program_end(game, m_result);
599
599
}
814
814
                        if (game.map().get_port_spaces().size() > 1) // we need at least two port build spaces
815
815
                                return ps.program_step(game, 0);
816
816
                        else {
817
 
                                ps.set_result_string("No use for ships on this map!");
 
817
                                ps.set_production_result("No use for ships on this map!");
818
818
                                return ps.program_end(game, None);
819
819
                        }
820
820
                }
969
969
                         % ngettext(" is missing", " are missing", nr_missing_groups))
970
970
                         .str();
971
971
 
972
 
                ps.set_result_string(result_string.c_str());
 
972
                ps.set_production_result(result_string);
973
973
                return ps.program_end(game, Failed);
974
974
        } else { //  we fulfilled all consumption requirements
975
975
                for (size_t i = 0; i < nr_warequeues; ++i)
1069
1069
 
1070
1070
        // Keep translateability in mind!
1071
1071
        /** TRANSLATORS: %s is a list of wares */
1072
 
        const std::string result_string = str(format(_("Produced %s")) % ware_list);
1073
 
        ps.set_result_string(result_string.c_str());
 
1072
        ps.set_production_result(str(format(_("Produced %s")) % ware_list));
1074
1073
}
1075
1074
 
1076
1075
bool ProductionProgram::ActProduce::get_building_work
1164
1163
        std::string unit_string = i18n::localize_item_list(worker_descnames, i18n::ItemListType::AND);
1165
1164
 
1166
1165
        /** TRANSLATORS: %s is a list of workers */
1167
 
        std::string result_string = (boost::format(_("Recruited %s")) % unit_string).str();
1168
 
        ps.set_result_string(result_string.c_str());
 
1166
        ps.set_production_result((boost::format(_("Recruited %s")) % unit_string).str());
1169
1167
}
1170
1168
 
1171
1169
bool ProductionProgram::ActRecruit::get_building_work
1388
1386
        SoldierControl & ctrl = dynamic_cast<SoldierControl &>(ps);
1389
1387
        const std::vector<Soldier *> soldiers = ctrl.presentSoldiers();
1390
1388
        if (soldiers.empty()) {
1391
 
                ps.set_result_string(_("No soldier to train!"));
 
1389
                ps.set_production_result(_("No soldier to train!"));
1392
1390
                return ps.program_end(game, Skipped);
1393
1391
        }
1394
1392
        ps.molog("  Checking soldier (%u) level %d)\n", attribute, level);
1396
1394
        const std::vector<Soldier *>::const_iterator soldiers_end = soldiers.end();
1397
1395
        for (std::vector<Soldier *>::const_iterator it = soldiers.begin();; ++it) {
1398
1396
                if (it == soldiers_end) {
1399
 
                        ps.set_result_string(_("No soldier found for this training level!"));
 
1397
                        ps.set_production_result(_("No soldier found for this training level!"));
1400
1398
                        return ps.program_end(game, Skipped);
1401
1399
                }
1402
1400
                if        (attribute == atrHP)      {
1481
1479
 
1482
1480
        for (;; ++it) {
1483
1481
                if (it == soldiers_end) {
1484
 
                        ps.set_result_string(_("No soldier found for this training level!"));
 
1482
                        ps.set_production_result(_("No soldier found for this training level!"));
1485
1483
                        return ps.program_end(game, Skipped);
1486
1484
                }
1487
1485
                if        (attribute == atrHP)      {