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

Function writeWeaponInfo

bwapi/DocumentationGen/weapontypes.cpp:3–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "helpers.h"
2
3void writeWeaponInfo()
4{
5 std::ofstream of("weapontypes.dox");
6 for (auto t : WeaponTypes::allWeaponTypes())
7 {
8 if (t == WeaponTypes::Unknown || t == WeaponTypes::None) continue;
9 of << docEnum(t);
10 of << docBegin(t);
11
12 of << icon(t) << " " << docIntro(t) << "\n";
13
14 of << "<table>";
15 if (t.getTech() != TechTypes::None) of << row("Technology", iconref(t.getTech()));
16 of << row("What uses this?", iconref(t.whatUses()));
17 of << row("Damage", t.damageAmount());
18 of << row("Damage Bonus", t.damageBonus());
19 of << row("Base Cooldown", t.damageCooldown());
20 of << row("Damage Factor", t.damageFactor());
21 of << row("Upgrade", iconref(t.upgradeType()));
22 of << row("DamageType", tref(t.damageType()));
23 of << row("ExplosionType", tref(t.explosionType()));
24 if (t.minRange() != 0) of << row("Minimum Range", t.minRange());
25 of << row("Maximum Range", t.maxRange());
26
27 if (t.innerSplashRadius() != 0 || t.medianSplashRadius() != 0 || t.outerSplashRadius() != 0)
28 {
29 std::ostringstream ssSplash;
30 ssSplash << t.innerSplashRadius() << ", " << t.medianSplashRadius() << ", " << t.outerSplashRadius();
31 of << row("Splash Radii", ssSplash.str());
32 }
33
34 std::vector<std::string> attributes;
35#define ATTRIB_TEST(x) if (t.targets ## x()) attributes.push_back(#x);
36 ATTRIB_TEST(Air);
37 ATTRIB_TEST(Ground);
38 ATTRIB_TEST(Mechanical);
39 ATTRIB_TEST(Organic);
40 ATTRIB_TEST(NonBuilding);
41 ATTRIB_TEST(NonRobotic);
42 ATTRIB_TEST(Terrain);
43 ATTRIB_TEST(OrgOrMech);
44 ATTRIB_TEST(Own);
45#undef ATTRIB_TEST
46 of << row("Target Attributes", makelist(attributes));
47 of << "</table>\n";
48
49 of << docEnd();
50 }
51}

Callers 1

mainFunction · 0.85

Calls 15

docEnumFunction · 0.85
docBeginFunction · 0.85
iconFunction · 0.85
docIntroFunction · 0.85
rowFunction · 0.85
iconrefFunction · 0.85
makelistFunction · 0.85
docEndFunction · 0.85
whatUsesMethod · 0.80
damageAmountMethod · 0.80
damageBonusMethod · 0.80
damageCooldownMethod · 0.80

Tested by

no test coverage detected