| 1 | #include "helpers.h" |
| 2 | |
| 3 | void writeUpgradeInfo() |
| 4 | { |
| 5 | std::ofstream of("upgradetypes.dox"); |
| 6 | for (auto t : UpgradeTypes::allUpgradeTypes()) |
| 7 | { |
| 8 | if (t == UpgradeTypes::Unknown || t == UpgradeTypes::None) continue; |
| 9 | of << docEnum(t); |
| 10 | of << docBegin(t); |
| 11 | |
| 12 | of << icon(t) << " " << docIntro(t) << "\n"; |
| 13 | |
| 14 | of << "<table>"; |
| 15 | of << row("Race", tref(t.getRace())); |
| 16 | |
| 17 | std::string oreCost = imgOre() + std::to_string(t.mineralPrice()); |
| 18 | if (t.maxRepeats() > 1) oreCost += " + lvl*" + std::to_string(t.mineralPriceFactor()); |
| 19 | std::string gasCost = imgGas(t.getRace()) + std::to_string(t.gasPrice()); |
| 20 | if (t.maxRepeats() > 1) gasCost += " + lvl*" + std::to_string(t.gasPriceFactor()); |
| 21 | of << row("Cost", oreCost + " " + gasCost); |
| 22 | |
| 23 | std::string timeCost = std::to_string(t.upgradeTime()); |
| 24 | if (t.maxRepeats() > 1) timeCost += " + lvl*" + std::to_string(t.upgradeTimeFactor()); |
| 25 | timeCost += " frames"; |
| 26 | of << row("Upgrade Time", timeCost); |
| 27 | |
| 28 | if (t.maxRepeats() != 1) of << row("Maximum Level", t.maxRepeats()); |
| 29 | if (t.whatUpgrades() != UnitTypes::None) of << row("Upgraded at", iconref(t.whatUpgrades())); |
| 30 | if (!t.whatUses().empty()) of << row("Used by", makeiconlist(t.whatUses())); |
| 31 | if (t.whatsRequired(1) != UnitTypes::None) of << row("Level 1 Requires", iconref(t.whatsRequired(1))); |
| 32 | if (t.whatsRequired(2) != UnitTypes::None) of << row("Level 2 Requires", iconref(t.whatsRequired(2))); |
| 33 | if (t.whatsRequired(3) != UnitTypes::None) of << row("Level 3 Requires", iconref(t.whatsRequired(3))); |
| 34 | |
| 35 | of << "</table>\n"; |
| 36 | |
| 37 | of << docEnd(); |
| 38 | } |
| 39 | } |
no test coverage detected