コミットメタ情報

リビジョン0276486e3caca82fa5e4ee3e32b202be90d71c50 (tree)
日時2018-12-29 17:31:06
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

戦闘後のHPの矛盾と勝利判定の矛盾を一度に確認する

変更サマリ

差分

--- a/KancolleSniffer.Test/BattleTest.cs
+++ b/KancolleSniffer.Test/BattleTest.cs
@@ -97,7 +97,7 @@ namespace KancolleSniffer.Test
9797 {
9898 var sniffer = new Sniffer();
9999 SniffLogFile(sniffer, "practice_001");
100- PAssert.That(() => !sniffer.IsBattleResultStatusError);
100+ PAssert.That(() => !sniffer.IsBattleResultError);
101101 }
102102
103103 /// <summary>
@@ -108,7 +108,7 @@ namespace KancolleSniffer.Test
108108 {
109109 var sniffer = new Sniffer();
110110 SniffLogFile(sniffer, "practice_002");
111- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);
111+ PAssert.That(() => !sniffer.IsBattleResultError);
112112 }
113113
114114 /// <summary>
@@ -130,7 +130,7 @@ namespace KancolleSniffer.Test
130130 {
131131 var sniffer = new Sniffer();
132132 SniffLogFile(sniffer, "combined_battle_001");
133- PAssert.That(() => !sniffer.IsBattleResultStatusError);
133+ PAssert.That(() => !sniffer.IsBattleResultError);
134134 }
135135
136136 /// <summary>
@@ -141,7 +141,7 @@ namespace KancolleSniffer.Test
141141 {
142142 var sniffer = new Sniffer();
143143 SniffLogFile(sniffer, "combined_battle_002");
144- PAssert.That(() => !sniffer.IsBattleResultStatusError);
144+ PAssert.That(() => !sniffer.IsBattleResultError);
145145 }
146146
147147 /// <summary>
@@ -152,7 +152,7 @@ namespace KancolleSniffer.Test
152152 {
153153 var sniffer = new Sniffer();
154154 SniffLogFile(sniffer, "combined_battle_003");
155- PAssert.That(() => !sniffer.IsBattleResultStatusError);
155+ PAssert.That(() => !sniffer.IsBattleResultError);
156156 }
157157
158158 /// <summary>
@@ -176,7 +176,7 @@ namespace KancolleSniffer.Test
176176 {
177177 var sniffer = new Sniffer();
178178 SniffLogFile(sniffer, "sp_midnight_002");
179- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);
179+ PAssert.That(() => !sniffer.IsBattleResultError);
180180 }
181181
182182 /// <summary>
@@ -187,7 +187,7 @@ namespace KancolleSniffer.Test
187187 {
188188 var sniffer = new Sniffer();
189189 SniffLogFile(sniffer, "nighttoday_001");
190- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError && !sniffer.IsBattleResultStatusError);
190+ PAssert.That(() => !sniffer.IsBattleResultError);
191191 }
192192
193193 /// <summary>
@@ -211,7 +211,7 @@ namespace KancolleSniffer.Test
211211 var sniffer = new Sniffer();
212212 SniffLogFile(sniffer, "escape_002");
213213 PAssert.That(() => sniffer.Fleets[2].Ships[1].Escaped);
214- PAssert.That(() => !sniffer.IsBattleResultStatusError);
214+ PAssert.That(() => !sniffer.IsBattleResultError);
215215 }
216216
217217 /// <summary>
@@ -255,7 +255,7 @@ namespace KancolleSniffer.Test
255255 {
256256 var sniffer = new Sniffer();
257257 SniffLogFile(sniffer, "nelsontouch_001");
258- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);
258+ PAssert.That(() => !sniffer.IsBattleResultError);
259259 PAssert.That(() => sniffer.Battle.Result.Friend.Main[0].SpecialAttack == ShipStatus.Attack.Fire);
260260 PAssert.That(() => sniffer.Fleets[0].Ships[0].SpecialAttack == ShipStatus.Attack.Fired);
261261 // ship_deckでフラグを引き継ぐ
@@ -273,7 +273,7 @@ namespace KancolleSniffer.Test
273273 {
274274 var sniffer = new Sniffer();
275275 SniffLogFile(sniffer, "nagatospecial_001");
276- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);
276+ PAssert.That(() => !sniffer.IsBattleResultError);
277277 PAssert.That(() => sniffer.Battle.Result.Friend.Main[0].SpecialAttack == ShipStatus.Attack.Fire);
278278 PAssert.That(() => sniffer.Fleets[0].Ships[0].SpecialAttack == ShipStatus.Attack.Fired);
279279 }
@@ -286,8 +286,7 @@ namespace KancolleSniffer.Test
286286 {
287287 var sniffer = new Sniffer();
288288 SniffLogFile(sniffer, "ld_shooting_001");
289- PAssert.That(() => !sniffer.IsBattleResultStatusError);
290- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);
289+ PAssert.That(() => !sniffer.IsBattleResultError);
291290 }
292291 }
293292 }
\ No newline at end of file
--- a/KancolleSniffer/ErrorLog.cs
+++ b/KancolleSniffer/ErrorLog.cs
@@ -18,7 +18,6 @@ using System.IO;
1818 using System.IO.Compression;
1919 using System.Linq;
2020 using System.Text;
21-using System.Text.RegularExpressions;
2221 using System.Windows.Forms;
2322 using KancolleSniffer.Model;
2423 using KancolleSniffer.Util;
@@ -52,7 +51,7 @@ namespace KancolleSniffer
5251 }
5352 else if (_prevBattleState == BattleState.Result &&
5453 // battleresultのあとのship_deckかportでのみエラー判定する
55- IsBattleResultError)
54+ _sniffer.IsBattleResultError)
5655 {
5756 throw new BattleResultError();
5857 }
@@ -63,9 +62,6 @@ namespace KancolleSniffer
6362 }
6463 }
6564
66- private bool IsBattleResultError =>
67- _sniffer.Battle.DisplayedResultRank.IsError || _sniffer.IsBattleResultStatusError;
68-
6965 public string GenerateBattleErrorLog()
7066 {
7167 foreach (var logs in _battleApiLog)
--- a/KancolleSniffer/Sniffer.cs
+++ b/KancolleSniffer/Sniffer.cs
@@ -639,7 +639,7 @@ namespace KancolleSniffer
639639
640640 public ShipInfo.ShipStatusPair[] BattleResultStatusDiff => _shipInfo.BattleResultDiff;
641641
642- public bool IsBattleResultStatusError => _shipInfo.IsBattleResultError;
642+ public bool IsBattleResultError => _shipInfo.IsBattleResultError || _battleInfo.DisplayedResultRank.IsError;
643643
644644 public ShipStatus[] BattleStartStatus => _shipInfo.BattleStartStatus;
645645
旧リポジトリブラウザで表示