MCPcopy Create free account
hub / github.com/bwapi/bwapi / writeTechInfo

Function writeTechInfo

bwapi/DocumentationGen/techtypes.cpp:6–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <string>
5
6void 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}

Callers 1

mainFunction · 0.85

Calls 15

docEnumFunction · 0.85
docBeginFunction · 0.85
iconFunction · 0.85
docIntroFunction · 0.85
rowFunction · 0.85
imgOreFunction · 0.85
imgGasFunction · 0.85
imgEnergyFunction · 0.85
iconrefFunction · 0.85
makelistFunction · 0.85
makeiconlistFunction · 0.85
docEndFunction · 0.85

Tested by

no test coverage detected