コミットメタ情報

リビジョン2800fe9b0a6102c51dacfd82448d10874c9b0378 (tree)
日時2018-08-02 19:54:04
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

BattleInfoで現在の艦隊をFleetオブジェクトで保持する

変更サマリ

差分

--- a/KancolleSniffer/Model/BattleInfo.cs
+++ b/KancolleSniffer/Model/BattleInfo.cs
@@ -53,7 +53,7 @@ namespace KancolleSniffer.Model
5353 {
5454 private readonly ShipInfo _shipInfo;
5555 private readonly ItemInfo _itemInfo;
56- private int _fleet;
56+ private Fleet _fleet;
5757 private Record[] _friend;
5858 private Record[] _guard;
5959 private Record[] _enemy;
@@ -129,11 +129,10 @@ namespace KancolleSniffer.Model
129129 if (_friend != null)
130130 return;
131131 _shipInfo.SaveBattleStartStatus();
132- _fleet = DeckId(json);
133132 var fleets = _shipInfo.Fleets;
134- var fstats = fleets[_fleet].Ships;
135- FlagshipRecovery(request, fstats[0]);
136- _friend = Record.Setup(fstats, practice);
133+ _fleet = fleets[DeckId(json)];
134+ FlagshipRecovery(request, _fleet.Ships[0]);
135+ _friend = Record.Setup(_fleet.Ships, practice);
137136 _guard = json.api_f_nowhps_combined()
138137 ? Record.Setup(fleets[1].Ships, practice)
139138 : new Record[0];
@@ -226,7 +225,7 @@ namespace KancolleSniffer.Model
226225 var fleets = _shipInfo.Fleets;
227226 if (_guard.Length > 0 && _enemyGuard.Length > 0)
228227 return fleets[0].FighterPower.Zip(fleets[1].FighterPower, (a, b) => a + b).ToArray();
229- return fleets[_fleet].FighterPower;
228+ return _fleet.FighterPower;
230229 }
231230
232231 private EnemyFighterPower CalcEnemyFighterPower(dynamic json)
@@ -515,7 +514,7 @@ namespace KancolleSniffer.Model
515514 var fleets = _shipInfo.Fleets;
516515 var ships = _guard.Length > 0
517516 ? fleets[0].Ships.Concat(fleets[1].Ships)
518- : fleets[_fleet].Ships;
517+ : _fleet.Ships;
519518 foreach (var entry in ships.Zip(_friend.Concat(_guard), (ship, now) => new {ship, now}))
520519 entry.now.UpdateShipStatus(entry.ship);
521520 if (warnDamagedShip)
旧リポジトリブラウザで表示