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; } }
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))); } }
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))); } }
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)); }
internal BuildingDock(kcsapi_kdock rawData) { this.Update(rawData); }
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; }
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; } } }
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; } }