• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión751707197da8f9b632e96a7022b6089d541b0fef (tree)
Tiempo2020-02-21 19:56:53
AutorKazuhiro Fujieda <fujieda@user...>
CommiterKazuhiro Fujieda

Log Message

報告書の海戦に中破艦を表示する

Cambiar Resumen

Diferencia incremental

--- a/KancolleSniffer.Test/BattleLogProcessorTest.cs
+++ b/KancolleSniffer.Test/BattleLogProcessorTest.cs
@@ -41,11 +41,14 @@ namespace KancolleSniffer.Test
4141 input[14] = "5/36";
4242 input[15] = "綾波改二(Lv148)";
4343 input[16] = "20/37";
44+ input[17] = "夕立改二(Lv148)";
45+ input[18] = "18/36";
4446 input[37] = "制空権確保";
4547 var result = new BattleLogProcessor().Process(input);
4648 PAssert.That(() => result[5] == "T字有利");
4749 PAssert.That(() => result[37] == "確保");
4850 PAssert.That(() => result[38] == "龍鳳改(Lv97)・夕立改(Lv148)");
51+ PAssert.That(() => result[39] == "夕立改二(Lv148)");
4952 }
5053
5154 [TestMethod]
@@ -100,7 +103,7 @@ namespace KancolleSniffer.Test
100103 var result = new BattleLogProcessor().Process(input);
101104 PAssert.That(() => result[21] == "潮改二(Lv94)・龍驤改二(Lv99)" &&
102105 result[22] == "33/33・50/50");
103- PAssert.That(() => result.Length == 40);
106+ PAssert.That(() => result.Length == 41);
104107 }
105108
106109 [TestMethod]
@@ -109,7 +112,7 @@ namespace KancolleSniffer.Test
109112 var input = Enumerable.Repeat("", 38).ToArray();
110113 input[1] = "サーモン海域";
111114 var result = new BattleLogProcessor(new Dictionary<string, string> {{"サーモン海域", "5-4"}}).Process(input);
112- PAssert.That(() => result[39] == "5-4");
115+ PAssert.That(() => result[40] == "5-4");
113116 }
114117 }
115118 }
\ No newline at end of file
--- a/KancolleSniffer.Test/LogProcessorTest.cs
+++ b/KancolleSniffer.Test/LogProcessorTest.cs
@@ -68,7 +68,7 @@ namespace KancolleSniffer.Test
6868 result.First() ==
6969 "[\"2018-09-08 11:28:01\",\"鎮守府正面海域\",\"3\",\"ボス\",\"A\",\"同航戦\",\"単縦陣\",\"単縦陣\",\"敵主力艦隊\",\"駆逐艦\",\"雷\"," +
7070 "\"浜波改(Lv78)\",\"32/32\",\"涼風(Lv10)\",\"3/16\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"," +
71- "\"軽巡ホ級\",\"0/33\",\"駆逐イ級\",\"0/20\",\"駆逐イ級\",\"7/20\",\"\",\"\",\"\",\"\",\"\",\"\",\"0\",\"0\",\"\",\"涼風(Lv10)\",\"1-1\"]");
71+ "\"軽巡ホ級\",\"0/33\",\"駆逐イ級\",\"0/20\",\"駆逐イ級\",\"7/20\",\"\",\"\",\"\",\"\",\"\",\"\",\"0\",\"0\",\"\",\"涼風(Lv10)\",\"\",\"1-1\"]");
7272 }
7373
7474 /// <summary>
--- a/KancolleSniffer/Log/BattleLogProcessor.cs
+++ b/KancolleSniffer/Log/BattleLogProcessor.cs
@@ -62,9 +62,11 @@ namespace KancolleSniffer.Log
6262 if (data[7].EndsWith("航行序列"))
6363 data[7] = data[7].Substring(0, 4);
6464 data[37] = ShortenAirBattleResult(data[37]);
65- var result = new string[40];
66- result[38] = GenerateDamagedShip(data);
67- result[39] = map;
65+ var result = new string[41];
66+ var damage = GenerateDamagedShip(data);
67+ result[38] = damage[0];
68+ result[39] = damage[1];
69+ result[40] = map;
6870 Array.Copy(data, result, 38);
6971 return result;
7072 }
@@ -88,9 +90,10 @@ namespace KancolleSniffer.Log
8890 }
8991 }
9092
91- private static string GenerateDamagedShip(string[] data)
93+ private static string[] GenerateDamagedShip(string[] data)
9294 {
93- var damaged = new List<string>();
95+ var badly = new List<string>();
96+ var half = new List<string>();
9497 for (var i = 11; i < 11 + 12; i += 2)
9598 {
9699 if (data[i] == "")
@@ -99,18 +102,24 @@ namespace KancolleSniffer.Log
99102 var hp = data[i + 1];
100103 try
101104 {
102- damaged.AddRange(from entry in ship.Split('・').Zip(hp.Split('・'), (s, h) => new {s, h})
105+ foreach (var entry in from entry in ship.Split('・').Zip(hp.Split('・'), (s, h) => new {s, h})
103106 where entry.h.Contains("/")
104107 let nm = entry.h.Split('/').Select(int.Parse).ToArray()
105- where ShipStatus.CalcDamage(nm[0], nm[1]) == ShipStatus.Damage.Badly
106- select entry.s);
108+ let level = ShipStatus.CalcDamage(nm[0], nm[1])
109+ select new {level, name = entry.s})
110+ {
111+ if (entry.level == ShipStatus.Damage.Half)
112+ half.Add(entry.name);
113+ else if (entry.level == ShipStatus.Damage.Badly)
114+ badly.Add(entry.name);
115+ }
107116 }
108117 catch (FormatException)
109118 {
110- return "";
119+ return new[] {"", ""};
111120 }
112121 }
113- return string.Join("・", damaged);
122+ return new []{string.Join("・", badly), string.Join("・", half)};
114123 }
115124
116125 private static readonly Regex Kana = new Regex(@"\([^)]+\)\(", RegexOptions.Compiled);
--- a/LogViewer/tags.tag
+++ b/LogViewer/tags.tag
@@ -83,7 +83,7 @@ this.rangeTabChange = function(e) {
8383 <script>
8484 this.tables = [
8585 "<th>日付</th><th>海域</th><th>マップ</th><th>マス</th><th>ボス</th><th>ランク</th><th>ドロップ艦種</th><th>ドロップ艦娘", // ドロップ
86-"<th>日付</th><th style=\"min-width: 3.2em;\">海域</th><th>マップ</th><th>マス</th><th>ボス</th><th>ランク</th><th>艦隊行動</th><th>味方陣形</th><th>敵陣形</th><th style=\"min-width: 3.2em;\">敵艦隊</th><th>味方艦1</th><th>味方艦1HP</th><th>味方艦2</th><th>味方艦2HP</th><th>味方艦3</th><th>味方艦3HP</th><th>味方艦4</th><th>味方艦4HP</th><th>味方艦5</th><th>味方艦5HP</th><th>味方艦6</th><th>味方艦6HP</th><th>大破艦</ht><th style=\"min-width: 2.2em;\">敵艦1</th><th>敵艦1HP</th><th style=\"min-width: 2.2em;\">敵艦2</th><th>敵艦2HP</th><th style=\"min-width: 2.2em;\">敵艦3</th><th>敵艦3HP</th><th style=\"min-width: 2.2em;\">敵艦4</th><th>敵艦4HP</th><th style=\"min-width: 2.2em;\">敵艦5</th><th>敵艦5HP</th><th style=\"min-width: 2.2em;\">敵艦6</th><th>敵艦6HP</th><th>味方制空値</th><th>敵制空値</th><th>制空状態</th>", // 海戦
86+"<th>日付</th><th style=\"min-width: 3.2em;\">海域</th><th>マップ</th><th>マス</th><th>ボス</th><th>ランク</th><th>艦隊行動</th><th>味方陣形</th><th>敵陣形</th><th style=\"min-width: 3.2em;\">敵艦隊</th><th>味方艦1</th><th>味方艦1HP</th><th>味方艦2</th><th>味方艦2HP</th><th>味方艦3</th><th>味方艦3HP</th><th>味方艦4</th><th>味方艦4HP</th><th>味方艦5</th><th>味方艦5HP</th><th>味方艦6</th><th>味方艦6HP</th><th>大破艦</th><th>中破艦</th><th style=\"min-width: 2.2em;\">敵艦1</th><th>敵艦1HP</th><th style=\"min-width: 2.2em;\">敵艦2</th><th>敵艦2HP</th><th style=\"min-width: 2.2em;\">敵艦3</th><th>敵艦3HP</th><th style=\"min-width: 2.2em;\">敵艦4</th><th>敵艦4HP</th><th style=\"min-width: 2.2em;\">敵艦5</th><th>敵艦5HP</th><th style=\"min-width: 2.2em;\">敵艦6</th><th>敵艦6HP</th><th>味方制空値</th><th>敵制空値</th><th>制空状態</th>", // 海戦
8787 "<th>日付</th><th>結果</th><th>遠征</th><th>燃料</th><th>弾薬</th><th>鋼材</th><th>ボーキ</th><th>開発資材</th><th>高速修復材</th><th>高速建造材</th><th>改修資材</th>", // 遠征
8888 "<th>日付</th><th>開発装備</th><th>種別</th><th>燃料</th><th>弾薬</th><th>鋼材</th><th>ボーキ</th><th>秘書艦</th><th>司令部Lv</th>", // 開発
8989 "<th>日付</th><th>種類</th><th>名前</th><th>艦種</th><th>燃料</th><th>弾薬</th><th>鋼材</th><th>ボーキ</th><th>開発資材</th><th>空きドック</th><th>秘書艦</th><th>司令部Lv</th>", // 建造
@@ -147,18 +147,20 @@ this.tableOptions = function(tableId) {
147147 };
148148
149149 this.dropColumns = function() {
150- return [{data: 0}, {data: 1}, {data: 39}, {data: 2}, {data: 3}, {data: 4}, {data: 9}, {data: 10}];
150+ return [{data: 0}, {data: 1}, {data: 40}, {data: 2}, {data: 3}, {data: 4}, {data: 9}, {data: 10}];
151151 };
152152
153153 this.sortieColumns = function() {
154154 var entries = [];
155155 for (var i = 0; i < 38; i++) {
156156 if (i === 2)
157- entries.push({data: 39});
157+ entries.push({data: 40});
158158 if (i === 9 || i === 10)
159159 continue;
160- if (i === 23)
160+ if (i === 23) {
161161 entries.push({data: 38});
162+ entries.push({data: 39});
163+ }
162164 entries.push({data: i});
163165 }
164166 return entries;