| 4 | #include <string> |
| 5 | |
| 6 | void writeTechInfo() |
| 7 | { |
| 8 | std::ofstream of("techtypes.dox"); |
| 9 | for (auto t : TechTypes::allTechTypes()) |
| 10 | { |
| 11 | if (t == TechTypes::Unknown || t == TechTypes::None) continue; |
| 12 | of << docEnum(t); |
| 13 | of << docBegin(t); |
| 14 | |
| 15 | of << icon(t) << " " << docIntro(t) << "\n"; |
| 16 | |
| 17 | of << "<table>"; |
| 18 | of << row("Race", tref(t.getRace())); |
| 19 | |
| 20 | if (t.mineralPrice() != 0 || t.gasPrice() != 0) |
| 21 | { |
| 22 | std::string oreCost = imgOre() + std::to_string(t.mineralPrice()); |
| 23 | std::string gasCost = imgGas(t.getRace()) + std::to_string(t.gasPrice()); |
| 24 | of << row("Cost", oreCost + " " + gasCost); |
| 25 | } |
| 26 | |
| 27 | if (t.researchTime() != 0) of << row("Research Time", std::to_string(t.researchTime()) + " frames"); |
| 28 | if (t.energyCost() != 0) of << row("Energy Cost", imgEnergy() + std::to_string(t.energyCost())); |
| 29 | |
| 30 | if (t.whatResearches() != UnitTypes::None) of << row("Researched at", iconref(t.whatResearches())); |
| 31 | if (t.requiredUnit() != UnitTypes::None) of << row("Requires", iconref(t.requiredUnit())); |
| 32 | |
| 33 | std::set<std::string> targets; |
| 34 | if (t.targetsPosition()) targets.insert("Positions"); |
| 35 | if (t.targetsUnit()) targets.insert("Units"); |
| 36 | if (!targets.empty()) of << row("Targets", makelist(targets)); |
| 37 | |
| 38 | if (t.getWeapon() != WeaponTypes::None) of << row("Weapon", iconref(t.getWeapon())); |
| 39 | if (t.getOrder() != Orders::None) of << row("Order", iconref(t.getOrder())); |
| 40 | |
| 41 | if (!t.whatUses().empty()) of << row("Used by", makeiconlist(t.whatUses())); |
| 42 | |
| 43 | of << "</table>\n"; |
| 44 | |
| 45 | // References |
| 46 | std::string const & name = t.getName(); |
| 47 | of << "@tl" << name << " @scc" << name << " @wik" << name; |
| 48 | of << docEnd(); |
| 49 | } |
| 50 | } |
no test coverage detected