コミットメタ情報

リビジョン74768dd79f88b37345fb37e304466129044453e2 (tree)
日時2018-08-07 20:55:02
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

連合艦隊の第二旗艦の大破警告が出るのを直す

変更サマリ

差分

--- a/KancolleSniffer.Test/SnifferTest.cs
+++ b/KancolleSniffer.Test/SnifferTest.cs
@@ -271,6 +271,17 @@ namespace KancolleSniffer.Test
271271 }
272272
273273 /// <summary>
274+ /// 連合艦隊の第二旗艦の大破を警告しない
275+ /// </summary>
276+ [TestMethod]
277+ public void NotWarnDamaged1StShipInGuardFleet()
278+ {
279+ var sniffer = new Sniffer();
280+ SniffLogFile(sniffer, "combined_battle_004");
281+ PAssert.That(() => !sniffer.BadlyDamagedShips.Any());
282+ }
283+
284+ /// <summary>
274285 /// 熟練度込みの制空値を正しく計算する
275286 /// </summary>
276287 [TestMethod]
--- a/KancolleSniffer.Test/logs
+++ b/KancolleSniffer.Test/logs
@@ -1 +1 @@
1-Subproject commit 37eb669f909a9aa27105af1ff3c956de0f62ae8c
1+Subproject commit 58854d8f5962f024c081fb2dc655570e18880d74
--- a/KancolleSniffer/Model/Fleet.cs
+++ b/KancolleSniffer/Model/Fleet.cs
@@ -104,12 +104,12 @@ namespace KancolleSniffer.Model
104104 ship.Fleet = null;
105105 ship.DeckIndex = -1;
106106 }
107- Ships = _deck.Select((id, idx) =>
107+ Ships = _deck.Select((id, num) =>
108108 {
109109 var ship = _shipInventry[id];
110110 if (ship.Empty)
111111 return ship;
112- ship.DeckIndex = id;
112+ ship.DeckIndex = num;
113113 ship.Fleet = this;
114114 return ship;
115115 }).ToArray();
--- a/KancolleSniffer/Model/ShipInfo.cs
+++ b/KancolleSniffer/Model/ShipInfo.cs
@@ -340,9 +340,10 @@ namespace KancolleSniffer.Model
340340 {
341341 BadlyDamagedShips =
342342 (from s in _fleets.Where(fleet => fleet.State == FleetState.Sortie)
343- .SelectMany(fleet => fleet.ActualShips)
344- where !s.Escaped && s.DamageLevel == ShipStatus.Damage.Badly &&
345- !(s.Fleet.CombinedType != 0 && s.Fleet.Number == 1 && s.DeckIndex == 0) // 第二艦隊の旗艦を除く
343+ .SelectMany(fleet => fleet.CombinedType != 0 && fleet.Number == 1
344+ ? fleet.ActualShips.Skip(1) // 第二艦隊の旗艦を除く
345+ : fleet.ActualShips)
346+ where !s.Escaped && s.DamageLevel == ShipStatus.Damage.Badly
346347 select s.Name).ToArray();
347348 }
348349
旧リポジトリブラウザで表示