Skip to content
Snippets Groups Projects
Commit 60811ac6 authored by Lorenz Martin Diel's avatar Lorenz Martin Diel
Browse files

small changes on xml

parent a42d1514
No related branches found
No related tags found
2 merge requests!9Xml,!8Xml
......@@ -53,6 +53,7 @@ namespace advanced_wars
unit_minRange[unitId] = minRange;
unit_maxRange[unitId] = maxRange;
/*
for (const auto &weapon : unit.second.get_child("Weapons"))
{
if (weapon.first == "PrimaryWeapon")
......@@ -65,7 +66,7 @@ namespace advanced_wars
std::string weaponName = weapon.second.get<std::string>("<xmlattr>.name");
unit_secondaryweapon[unitId] = weaponName;
}
}
}*/
for (const auto &weapon : unit.second.get_child("Weapons"))
{
......
......@@ -6,6 +6,9 @@
namespace advanced_wars
{
MatchupTabel_secondaryweapon secWeapon;
MatchupTabel_secondaryweapon primWeapon;
Unit::Unit(int x, int y, UnitFaction faction, UnitId id, UnitState state)
: x(x), y(y), faction(faction), id(id), state(state)
{
......@@ -180,8 +183,6 @@ namespace advanced_wars
void Unit::readXML()
{
MatchupTabel_secondaryweapon secWeapon;
MatchupTabel_secondaryweapon primWeapon;
Config config(secWeapon, primWeapon);
// Lade Konfigurationsdaten von XML
......
......@@ -27,13 +27,13 @@
<PrimaryWeapon name="Rockets">
<DamageTable>
<Damage unitId="infantry" value="65"/>
<Damage unitId="infantry" value="55"/>
<Damage unitId="Mech" value="55"/>
</DamageTable>
</PrimaryWeapon>
<SecondaryWeapon name="Machine-Gun">
<DamageTable>
<Damage unitId="infantry" value="65"/>
<Damage unitId="infantry" value="55"/>
<Damage unitId="Mech" value="55"/>
</DamageTable>
</SecondaryWeapon>
</Weapons>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment