OSDN Git Service

艦隊情報のテキスト形式で補強スロットが先に来るのを直す
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Sat, 3 Feb 2018 12:43:51 +0000 (21:43 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Thu, 8 Feb 2018 10:47:32 +0000 (19:47 +0900)
KancolleSniffer/BattleInfo.cs
KancolleSniffer/ShipStatus.cs

index 04dddc4..14e5035 100644 (file)
@@ -586,7 +586,7 @@ namespace KancolleSniffer
                 _status.NowHp = 0;\r
                 if (_practice)\r
                     return;\r
-                foreach (var item in _status.AllSlot)\r
+                foreach (var item in new[] {_status.SlotEx}.Concat(_status.Slot))\r
                 {\r
                     if (item.Spec.Id == 42)\r
                     {\r
index ca85652..c074583 100644 (file)
@@ -53,7 +53,7 @@ namespace KancolleSniffer
 \r
         public int CombinedFleetType { get; set; }\r
 \r
-        public IEnumerable<ItemStatus> AllSlot => SlotEx.Id == 0 ? Slot : new[] {SlotEx}.Concat(Slot);\r
+        public IEnumerable<ItemStatus> AllSlot => SlotEx.Id == 0 ? Slot : Slot.Concat(new[] {SlotEx});\r
 \r
         public ShipStatus()\r
         {\r
@@ -79,7 +79,9 @@ namespace KancolleSniffer
             if (now == 0 && max > 0)\r
                 return Damage.Sunk;\r
             var ratio = max == 0 ? 1 : (double)now / max;\r
-            return ratio > 0.75 ? Damage.Minor : ratio > 0.5 ? Damage.Small : ratio > 0.25 ? Damage.Half : Damage.Badly;\r
+            return ratio > 0.75 ? Damage.Minor :\r
+                ratio > 0.5 ? Damage.Small :\r
+                ratio > 0.25 ? Damage.Half : Damage.Badly;\r
         }\r
 \r
         public TimeSpan RepairTime => TimeSpan.FromSeconds((int)(RepairTimePerHp.TotalSeconds * (MaxHp - NowHp)) + 30);\r