internal void Update(kcsapi_ndock[] source) { if (this.Docks.Count == source.Length) { foreach (var raw in source) this.Docks[raw.api_id]?.Update(raw); } else { foreach (var dock in this.Docks) dock.Value?.Dispose(); this.Docks = new MemberTable<RepairingDock>(source.Select(x => new RepairingDock(this.homeport, x))); } }
internal void Update(kcsapi_ndock[] source) { if (this.Docks.Count == source.Length) { foreach (var raw in source) { var target = this.Docks[raw.api_id]; if (target != null) target.Update(raw); } } else { this.Docks.ForEach(x => x.Value.Dispose()); this.Docks = new MemberTable<RepairingDock>(source.Select(x => new RepairingDock(homeport, x))); } }
private void Update(kcsapi_ndock[] source) { if (this.Docks.Count == source.Length) { foreach (var raw in source) { var target = this.Docks[raw.api_id]; if (target != null) target.Update(raw); } } else { this.Docks = new MemberTable<RepairingDock>(source.Select(x => new RepairingDock(x))); } }
private void Update(kcsapi_ndock[] source) { if (this.Docks.Count == source.Length) { foreach (var raw in source) { var target = this.Docks[raw.api_id]; if (target != null) target.Update(raw); } } else { this.Docks.ForEach(x => x.Value.Dispose()); this.Docks = new MemberTable<RepairingDock>(source.Select(x => new RepairingDock(homeport, x))); } // 艦娘を入渠させたとき、ship2 -> ndock の順でデータが来るため、 // ndock の後で改めて各艦隊のステータスを更新してやらないと入渠ステータスに変更できない this.homeport.Fleets.ForEach(x => x.Value.UpdateStatus()); }