示例#1
0
        internal Fleet(Homeport parent, kcsapi_deck rawData)
        {
            this.homeport = parent;

            this.ReSortie = new FleetReSortie();
            this.Expedition = new Expedition(this);
            this.Update(rawData);
        }
示例#2
0
        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);
        }
示例#3
0
        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();
        }
示例#4
0
 /// <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)));
     }
 }
示例#5
0
		/// <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());
		}
示例#6
0
        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();
        }
示例#7
0
 internal Fleet(kcsapi_deck rawData)
 {
     this.Expedition = new Expedition(this);
     this.Update(rawData);
 }
示例#8
0
        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;
        }
示例#9
0
 internal void Update(kcsapi_deck source)
 {
     var fleet = this.Fleets[source.api_id];
     if (fleet != null)
     {
         fleet.Update(source);
         fleet.RaiseShipsUpdated();
     }
 }
示例#10
0
 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)));
     }
 }
示例#11
0
 /// <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));
 }
示例#12
0
 internal void Update(kcsapi_deck source)
 {
     this.Fleets[source.api_id]?.Update(source);
 }
示例#13
0
		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() }
				}
			};
		}