Пример #1
0
void writeTechInfo()
{
  std::ofstream of("techtypes.dox");
  for (auto t : TechTypes::allTechTypes())
  {
    if (t == TechTypes::Unknown || t == TechTypes::None) continue;
    of << docEnum(t);
    of << docBegin(t);

    of << icon(t) << " " << docIntro(t) << "\n";

    of << "<table border='0'>";
    of << row("Race", tref(t.getRace()));

    if (t.mineralPrice() != 0 || t.gasPrice() != 0)
    {
      std::string oreCost = imgOre() + std::to_string(t.mineralPrice());
      std::string gasCost = imgGas(t.getRace()) + std::to_string(t.gasPrice());
      of << row("Cost", oreCost + " " + gasCost);
    }

    if (t.researchTime() != 0) of << row("Research Time", std::to_string(t.researchTime()) + " frames");
    if (t.energyCost() != 0) of << row("Energy Cost", imgEnergy() + std::to_string(t.energyCost()));

    if (t.whatResearches() != UnitTypes::None) of << row("Researched at", iconref(t.whatResearches()));
    if (t.requiredUnit() != UnitTypes::None) of << row("Requires", iconref(t.requiredUnit()));

    std::set<std::string> targets;
    if (t.targetsPosition()) targets.insert("Positions");
    if (t.targetsUnit()) targets.insert("Units");
    if (!targets.empty()) of << row("Targets", makelist(targets));

    if (t.getWeapon() != WeaponTypes::None) of << row("Weapon", iconref(t.getWeapon()));
    if (t.getOrder() != Orders::None) of << row("Order", iconref(t.getOrder()));

    if (!t.whatUses().empty()) of << row("Used by", makeiconlist(t.whatUses()));
    
    of << "</table>\n";

    // References
    std::string const & name = t.getName();
    of << "@tl" << name << " @scc" << name << " @wik" << name;
    of << docEnd();
  }
}
Пример #2
0
void writeUpgradeInfo()
{
  std::ofstream of("upgradetypes.dox");
  for (auto t : UpgradeTypes::allUpgradeTypes())
  {
    if (t == UpgradeTypes::Unknown || t == UpgradeTypes::None) continue;
    of << docEnum(t);
    of << docBegin(t);

    of << icon(t) << " " << docIntro(t) << "\n";

    of << "<table border='0'>";
    of << row("Race", tref(t.getRace()));

    std::string oreCost = imgOre() + std::to_string(t.mineralPrice());
    if (t.maxRepeats() > 1) oreCost += " + lvl*" + std::to_string(t.mineralPriceFactor());
    std::string gasCost = imgGas(t.getRace()) + std::to_string(t.gasPrice());
    if (t.maxRepeats() > 1) gasCost += " + lvl*" + std::to_string(t.gasPriceFactor());
    of << row("Cost", oreCost + " " + gasCost);

    std::string timeCost = std::to_string(t.upgradeTime());
    if (t.maxRepeats() > 1) timeCost += " + lvl*" + std::to_string(t.upgradeTimeFactor());
    timeCost += " frames";
    of << row("Upgrade Time", timeCost);

    if (t.maxRepeats() != 1) of << row("Maximum Level", t.maxRepeats());
    if (t.whatUpgrades() != UnitTypes::None) of << row("Upgraded at", iconref(t.whatUpgrades()));
    if (!t.whatUses().empty()) of << row("Used by", makeiconlist(t.whatUses()));
    if (t.whatsRequired(1) != UnitTypes::None) of << row("Level 1 Requires", iconref(t.whatsRequired(1)));
    if (t.whatsRequired(2) != UnitTypes::None) of << row("Level 2 Requires", iconref(t.whatsRequired(2)));
    if (t.whatsRequired(3) != UnitTypes::None) of << row("Level 3 Requires", iconref(t.whatsRequired(3)));

    of << "</table>\n";

    of << docEnd();
  }
}
Пример #3
0
void SvgElementVisitor::visit(clan::DomElement &e)
{
	if (e.get_namespace_uri() != Svg::svg_ns) return;

	// To do: do a more efficient search for the correct handler

	auto local_name = e.get_local_name();
	if (local_name == "a") a(e);
	else if (local_name == "altGlyph") altGlyph(e);
	else if (local_name == "altGlyphDef") altGlyphDef(e);
	else if (local_name == "altGlyphItem") altGlyphItem(e);
	else if (local_name == "animate") animate(e);
	else if (local_name == "animateColor") animateColor(e);
	else if (local_name == "animateMotion") animateMotion(e);
	else if (local_name == "animateTransform") animateTransform(e);
	else if (local_name == "circle") circle(e);
	else if (local_name == "clipPath") clipPath(e);
	else if (local_name == "color-profile") color_profile(e);
	else if (local_name == "cursor") cursor(e);
	else if (local_name == "defs") defs(e);
	else if (local_name == "desc") desc(e);
	else if (local_name == "ellipse") ellipse(e);
	else if (local_name == "feBlend") feBlend(e);
	else if (local_name == "feColorMatrix") feColorMatrix(e);
	else if (local_name == "feComponentTransfer") feComponentTransfer(e);
	else if (local_name == "feComposite") feComposite(e);
	else if (local_name == "feConvolveMatrix") feConvolveMatrix(e);
	else if (local_name == "feDiffuseLighting") feDiffuseLighting(e);
	else if (local_name == "feDisplacementMap") feDisplacementMap(e);
	else if (local_name == "feDistantLight") feDistantLight(e);
	else if (local_name == "feFlood") feFlood(e);
	else if (local_name == "feFuncA") feFuncA(e);
	else if (local_name == "feFuncB") feFuncB(e);
	else if (local_name == "feFuncG") feFuncG(e);
	else if (local_name == "feFuncR") feFuncR(e);
	else if (local_name == "feGaussianBlur") feGaussianBlur(e);
	else if (local_name == "feImage") feImage(e);
	else if (local_name == "feMerge") feMerge(e);
	else if (local_name == "feMergeNode") feMergeNode(e);
	else if (local_name == "feMorphology") feMorphology(e);
	else if (local_name == "feOffset") feOffset(e);
	else if (local_name == "fePointLight") fePointLight(e);
	else if (local_name == "feSpecularLighting") feSpecularLighting(e);
	else if (local_name == "feSpotLight") feSpotLight(e);
	else if (local_name == "feTile") feTile(e);
	else if (local_name == "feTurbulence") feTurbulence(e);
	else if (local_name == "filter") filter(e);
	else if (local_name == "font") font(e);
	else if (local_name == "font-face") font_face(e);
	else if (local_name == "font-face-format") font_face_format(e);
	else if (local_name == "font-face-name") font_face_name(e);
	else if (local_name == "font-face-src") font_face_src(e);
	else if (local_name == "font-face-uri") font_face_uri(e);
	else if (local_name == "foreignObject") foreignObject(e);
	else if (local_name == "g") g(e);
	else if (local_name == "glyph") glyph(e);
	else if (local_name == "glyphRef") glyphRef(e);
	else if (local_name == "hkern") hkern(e);
	else if (local_name == "image") image(e);
	else if (local_name == "line") line(e);
	else if (local_name == "linearGradient") linearGradient(e);
	else if (local_name == "marker") marker(e);
	else if (local_name == "mask") mask(e);
	else if (local_name == "metadata") metadata(e);
	else if (local_name == "missing-glyph") missing_glyph(e);
	else if (local_name == "mpath") mpath(e);
	else if (local_name == "path") path(e);
	else if (local_name == "pattern") pattern(e);
	else if (local_name == "polygon") polygon(e);
	else if (local_name == "polyline") polyline(e);
	else if (local_name == "radialGradient") radialGradient(e);
	else if (local_name == "rect") rect(e);
	else if (local_name == "script") script(e);
	else if (local_name == "set") set(e);
	else if (local_name == "stop") stop(e);
	else if (local_name == "style") style(e);
	else if (local_name == "svg") svg(e);
	else if (local_name == "switch") switch_(e);
	else if (local_name == "symbol") symbol(e);
	else if (local_name == "text") text(e);
	else if (local_name == "textPath") textPath(e);
	else if (local_name == "title") title(e);
	else if (local_name == "tref") tref(e);
	else if (local_name == "tspan") tspan(e);
	else if (local_name == "use") use(e);
	else if (local_name == "view") view(e);
	else if (local_name == "vkern") vkern(e);
}