internal Fleet(Homeport parent, kcsapi_deck rawData) { this.homeport = parent; this.ReSortie = new FleetReSortie(); this.Expedition = new Expedition(this); this.Update(rawData); }
internal Fleet(Homeport parent, kcsapi_deck rawData) { this.homeport = parent; this.State = new FleetState(parent, this); this.Expedition = new Expedition(this); this.CompositeDisposable.Add(this.State); this.CompositeDisposable.Add(this.Expedition); this.Update(rawData); }
internal void Update(kcsapi_deck rawData) { this.Id = rawData.api_id; this.Name = rawData.api_name; this.Ships = rawData.api_ship.Select(id => this.homeport.Ships[id]).Where(x => x != null).ToArray(); this.AverageLevel = this.Ships.HasValue() ? this.Ships.Average(s => s.Level) : 0.0; this.AirSuperiorityPotential = this.Ships.Sum(s => s.CalcAirSuperiorityPotential()); this.Speed = this.Ships.All(s => s.Info.Speed == Speed.Fast) ? Speed.Fast : Speed.Low; this.ReSortie.Update(this.Ships); this.Expedition.Update(rawData.api_mission); this.UpdateStatus(); }
/// <summary> /// 指定した <see cref="kcsapi_deck"/> 型の配列を使用して、<see cref="Fleets"/> プロパティ値を更新します。 /// </summary> internal void Update(kcsapi_deck[] source) { if (this.Fleets.Count == source.Length) { foreach (var raw in source) { var target = this.Fleets[raw.api_id]; if (target != null) target.Update(raw); } } else { foreach (var fleet in this.Fleets) fleet.Value.SafeDispose(); this.Fleets = new MemberTable<Fleet>(source.Select(x => new Fleet(this.homeport, x))); } }
/// <summary> /// 指定した <see cref="kcsapi_deck"/> を使用して艦隊の情報をすべて更新します。 /// </summary> /// <param name="rawData">エンド ポイントから取得したデータ。</param> internal void Update(kcsapi_deck rawData) { this.Id = rawData.api_id; this.Name = rawData.api_name; this.Expedition.Update(rawData.api_mission); this.UpdateShips(rawData.api_ship.Select(id => this.homeport.Organization.Ships[id]).ToArray()); }
internal void Update(kcsapi_deck rawData) { this.Id = rawData.api_id; this.Name = rawData.api_name; this.Ships = rawData.api_ship.Select(id => this.homeport.Ships[id]).Where(x => x != null).ToArray(); this.ReSortie.Update(this.Ships); this.Expedition.Update(rawData.api_mission); this.UpdateStatus(); }
internal Fleet(kcsapi_deck rawData) { this.Expedition = new Expedition(this); this.Update(rawData); }
internal void Update(kcsapi_deck rawData) { this.Id = rawData.api_id; this.Name = rawData.api_name; this.Ships = rawData.api_ship.Select(id => KanColleClient.Current.Homeport.Ships[id]).Where(x => x != null).ToArray(); this.Expedition.Update(rawData.api_mission); if (this.Expedition.IsInExecution) this.State = FleetState.Expedition; else if(KanColleClient.Current.Homeport.Repairyard.CheckRepairing(this)) this.State = FleetState.Repairing; else this.State = FleetState.Ready; }
internal void Update(kcsapi_deck source) { var fleet = this.Fleets[source.api_id]; if (fleet != null) { fleet.Update(source); fleet.RaiseShipsUpdated(); } }
private void UpdateFleets(kcsapi_deck[] source) { if (this.Fleets.Count == source.Length) { foreach (var raw in source) { var target = this.Fleets[raw.api_id]; if (target != null) target.Update(raw); } } else { this.Fleets = new MemberTable<Fleet>(source.Select(x => new Fleet(x))); } }
/// <summary> /// 指定した <see cref="kcsapi_deck"/> 型の配列を使用して、<see cref="Fleets"/> プロパティ値を更新します。 /// </summary> internal void Update(kcsapi_deck[] source) { if(this.Fleets.SetValueRange(source, x => x.api_id, x => new Fleet(this.homeport, x), (obj, dat) => obj.Update(dat), true, x => x.Dispose())) RaisePropertyChanged(nameof(Fleets)); }
internal void Update(kcsapi_deck source) { this.Fleets[source.api_id]?.Update(source); }
internal Fleet(Homeport parent, kcsapi_deck rawData) { this.homeport = parent; this.Condition = new FleetCondition(this); this.Expedition = new Expedition(this); this.Update(rawData); this.compositeDisposable = new LivetCompositeDisposable { new PropertyChangedWeakEventListener(KanColleClient.Current.Settings) { { "ViewRangeCalcLogic", (sender, args) => this.Calculate() } } }; }