Exemplo n.º 1
0
 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)));
     }
 }
Exemplo n.º 2
0
		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)));
			}
		}
Exemplo n.º 3
0
 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)));
     }
 }
Exemplo n.º 4
0
        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());
        }