diff --git a/TankInspector/Modeling/Tank/Chassis.cs b/TankInspector/Modeling/Tank/Chassis.cs index bc400a0..95155af 100644 --- a/TankInspector/Modeling/Tank/Chassis.cs +++ b/TankInspector/Modeling/Tank/Chassis.cs @@ -12,9 +12,9 @@ internal class Chassis : DamageableModule, IHasArmor, IChassis public Armor Armor { get; private set; } [Stat("ChassisArmorFullName", DataAnalysis.ComparisonMode.HigherBetter)] - public double TrackArmor => this.Armor.ArmorGroups["leftTrack"].Value; + public double TrackArmor {get; private set; } - private double _maxClimbAngle; + private double _maxClimbAngle; public double MaxClimbAngle => _maxClimbAngle; private double _maxLoad; @@ -53,12 +53,11 @@ internal class Chassis : DamageableModule, IHasArmor, IChassis public SpeedLimits SpeedLimits { get; internal set; } - public Chassis(Database database) : base(database) { this.Wheels = new WheelInfo(); - } + } protected override bool DeserializeSection(string name, XmlReader reader) { @@ -67,6 +66,11 @@ protected override bool DeserializeSection(string name, XmlReader reader) case "armor": this.Armor = new Armor(((Tank)this.Owner).Nation.Database); this.Armor.Deserialize(reader); + foreach (var item in this.Armor.ArmorGroups.Keys) + { + this.TrackArmor = this.Armor.ArmorGroups[item].Value; + break; + } return true; case "maxClimbAngle": diff --git a/TankInspector/TankInspector.csproj b/TankInspector/TankInspector.csproj index 1f709f3..42f5000 100644 --- a/TankInspector/TankInspector.csproj +++ b/TankInspector/TankInspector.csproj @@ -201,6 +201,7 @@ + @@ -233,6 +234,7 @@ +