コミットメタ情報

リビジョンa6002d6a7a28165cde3b2367b5d4a8150b381647 (tree)
日時2018-03-23 22:43:26
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

基地航空隊の出撃コストを表示する

変更サマリ

差分

--- a/KancolleSniffer.Test/SnifferTest.cs
+++ b/KancolleSniffer.Test/SnifferTest.cs
@@ -306,6 +306,17 @@ namespace KancolleSniffer.Test
306306 }
307307
308308 /// <summary>
309+ /// 基地航空隊の出撃コストを計算する
310+ /// </summary>
311+ [TestMethod]
312+ public void CostForSortieOfBaseAirCorps()
313+ {
314+ var sniffer = new Sniffer();
315+ SniffLogFile(sniffer, "baseaircorps_003");
316+ PAssert.That(() => sniffer.BaseAirCorps[1].AirCorps[0].CostForSortie.SequenceEqual(new[] {99, 47}));
317+ }
318+
319+ /// <summary>
309320 /// 陸上戦闘機の改修レベルを制空値に反映させる。
310321 /// </summary>
311322 [TestMethod]
--- a/KancolleSniffer/BaseAirCoprs.cs
+++ b/KancolleSniffer/BaseAirCoprs.cs
@@ -89,6 +89,24 @@ namespace KancolleSniffer
8989 return new[] {prev[0] + cur[0], prev[1] + cur[1]};
9090 }).Select(fp => (int)(fp * reconPlaneBonus)).ToArray();
9191 }
92+
93+ public int[] CostForSortie => Planes.Aggregate(new[] {0, 0}, (prev, plane) =>
94+ {
95+ if (plane.State != 1)
96+ return prev;
97+ int fuel, bull;
98+ if (plane.Slot.Spec.Type == 47)
99+ {
100+ fuel = (int)Math.Ceiling(plane.Count * 1.5);
101+ bull = (int)(plane.Count * 0.7);
102+ }
103+ else
104+ {
105+ fuel = plane.Count;
106+ bull = (int)Math.Ceiling(plane.Count * 0.6);
107+ }
108+ return new[] {prev[0] + fuel, prev[1] + bull};
109+ });
92110 }
93111
94112 public class PlaneInfo
--- a/KancolleSniffer/FleetPanel.cs
+++ b/KancolleSniffer/FleetPanel.cs
@@ -35,6 +35,7 @@ namespace KancolleSniffer
3535 public string Fleet { get; set; }
3636 public string Fleet2 { get; set; }
3737 public string Ship { get; set; }
38+ public string Ship2 { get; set; }
3839 public int Id { get; set; }
3940 public string Equip { get; set; }
4041 public Color Color { get; set; }
@@ -124,6 +125,7 @@ namespace KancolleSniffer
124125 var ship = new Record
125126 {
126127 Ship = (s.Escaped ? "[避]" : "") + s.Name + " Lv" + s.Level,
128+ Ship2 = "",
127129 Id = s.Id,
128130 // ReSharper disable CompareOfFloatsByEqualityOperator
129131 Spec = (fire == 0 ? "" : $"砲{fire:f1}") + (subm == 0 ? "" : $" 潜{subm:f1}{oasa}"),
@@ -178,9 +180,11 @@ namespace KancolleSniffer
178180 spec = "制空:" + RangeString(corpsFp.AirCombat);
179181 spec2 = corpsFp.IsInterceptor ? "制空(防空):" + RangeString(corpsFp.Interception) : "";
180182 }
183+ var cost = airCorps.CostForSortie;
181184 list.Add(new Record
182185 {
183186 Ship = name[i++] + " " + airCorps.ActionName,
187+ Ship2 = $"出撃コスト:燃{cost[0]}弾{cost[1]}",
184188 Spec = spec + " 距離:" + airCorps.Distance,
185189 Spec2 = spec2
186190 });
@@ -296,6 +300,8 @@ namespace KancolleSniffer
296300 var labels = _labelList[i];
297301 labels.Fleet.Text = e.Fleet;
298302 labels.Name.SetName(e.Ship);
303+ if (e.Ship2 != "")
304+ _toolTip.SetToolTip(labels.Name, e.Ship2);
299305 labels.Equip.Text = e.Equip;
300306 labels.EquipColor.Visible = e.Equip != "";
301307 labels.EquipColor.BackColor = e.Color;
旧リポジトリブラウザで表示