Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison API/Exporters/WarFoundryXMLWithXSLExporter.cs @ 419:71fceea2725b
Code tidy-up - remove warnings
* Add missing GetHashcode() implementations
* Remove unused exception variables
* Use unused event
* Remove dead code
* Properly override some methods
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 25 Sep 2011 20:52:27 +0100 |
parents | 2c52f0235774 |
children | cd367acd7c48 |
comparison
equal
deleted
inserted
replaced
418:6798a59c1b49 | 419:71fceea2725b |
---|---|
130 { | 130 { |
131 XmlElement armyEquipmentItem = armyList.CreateElement("equipmentItem"); | 131 XmlElement armyEquipmentItem = armyList.CreateElement("equipmentItem"); |
132 armyEquipmentItem.SetAttribute("name", equip.Name); | 132 armyEquipmentItem.SetAttribute("name", equip.Name); |
133 | 133 |
134 int armyEquipAmount = 0; | 134 int armyEquipAmount = 0; |
135 | 135 armyEquipAmount = (int)UnitEquipmentUtil.GetEquipmentAmount(uni, equip); |
136 if (UnitEquipmentUtil.GetEquipmentAmount(uni, equip) == null) | |
137 { | |
138 armyEquipAmount = 0; | |
139 } | |
140 else | |
141 { | |
142 armyEquipAmount = (int)UnitEquipmentUtil.GetEquipmentAmount(uni, equip); | |
143 } | |
144 | 136 |
145 if (UnitEquipmentUtil.GetEquipmentAmountIsRatio(uni, equip)) | 137 if (UnitEquipmentUtil.GetEquipmentAmountIsRatio(uni, equip)) |
146 { | 138 { |
147 float fraction = (float)(armyEquipAmount / 100.0); | 139 float fraction = (float)(armyEquipAmount / 100.0); |
148 armyEquipAmount = (int)(fraction * uni.Size); | 140 armyEquipAmount = (int)(fraction * uni.Size); |