コード例 #1
0
		private void KDock(kcsapi_kdock[] docks)
		{
			foreach (var dock in docks.Where(dock => this.waitingForShip && dock.api_id == this.dockid))
			{
				this.Log(LogType.BuildShip, "{0},{1},{2},{3},{4},{5},{6}", DateTime.Now.ToString(this.LogTimestampFormat), KanColleClient.Current.Master.Ships[dock.api_created_ship_id].Name, this.shipmats[0], this.shipmats[1], this.shipmats[2], this.shipmats[3], this.shipmats[4]);
				this.waitingForShip = false;
			}
		}
コード例 #2
0
ファイル: Dockyard.cs プロジェクト: nagatoyk/KanColleViewer
 internal void Update(kcsapi_kdock[] 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.SafeDispose();
         this.Docks = new MemberTable<BuildingDock>(source.Select(x => new BuildingDock(x)));
     }
 }
コード例 #3
0
ファイル: Dockyard.cs プロジェクト: ranai/KanColleViewer
 private void Update(kcsapi_kdock[] 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<BuildingDock>(source.Select(x => new BuildingDock(x)));
     }
 }
コード例 #4
0
ファイル: Dockyard.cs プロジェクト: c933103/KanColleViewer
 internal void Update(kcsapi_kdock[] source)
 {
     if(this.Docks.SetValueRange(source, x => x.api_id, x => new BuildingDock(x), (obj, dat) => obj.Update(dat), true, x => x.Dispose()))
         RaisePropertyChanged(nameof(Docks));
 }
コード例 #5
0
 internal BuildingDock(kcsapi_kdock rawData)
 {
     this.Update(rawData);
 }
コード例 #6
0
 internal void Update(kcsapi_kdock rawData)
 {
     this.Id = rawData.api_id;
     this.State = (BuildingDockState)rawData.api_state;
     this.Ship = this.State == BuildingDockState.Building || this.State == BuildingDockState.Completed
         ? KanColleClient.Current.Master.Ships[rawData.api_created_ship_id]
         : null;
     this.CompleteTime = this.State == BuildingDockState.Building
         ? (DateTimeOffset?)Definitions.UnixEpoch.AddMilliseconds(rawData.api_complete_time)
         : null;
 }
コード例 #7
0
ファイル: Logger.cs プロジェクト: Sinwee/KanColleViewer
 private void KDock(kcsapi_kdock[] docks)
 {
     foreach (var dock in docks)
     {
         if (waitingForShip && dock.api_id == dockid)
         {
             Log(LogType.BuildShip, "{0},{1},{2},{3},{4},{5},{6}", DateTime.Now.ToString("yyyy/M/d H:mm"), KanColleClient.Current.Master.Ships[dock.api_created_ship_id].Name, shipmats[0], shipmats[1], shipmats[2], shipmats[3], shipmats[4]);
             waitingForShip = false;
         }
     }
 }
コード例 #8
0
ファイル: Logger.cs プロジェクト: nfls20030708/KanColleViewer
        private void KDock(kcsapi_kdock[] docks)
        {
            try
            {
                foreach (var dock in docks.Where(dock => this.waitingForShip && dock.api_id == this.dockid))
                {
                    this.Log(LogType.BuildShip,
                             KanColleClient.Current.Master.Ships[dock.api_created_ship_id].Name, //Result
                             KanColleClient.Current.Homeport.Organization.Fleets[1].Ships[0].Info.Name, //Secretary
                             KanColleClient.Current.Homeport.Organization.Fleets[1].Ships[0].Level, //Secretary Level
                             this.shipmats[0], //Fuel
                             this.shipmats[1], //Ammo
                             this.shipmats[2], //Steel
                             this.shipmats[3], //Bauxite
                             this.shipmats[4] //Materials
                        );

                    this.waitingForShip = false;
                }
            }
            catch (Exception)
            {
                this.waitingForShip = false;
            }
        }