internal Master(kcsapi_start2 start2) { this.ShipTypes = new MasterTable<ShipType>(start2.api_mst_stype.Select(x => new ShipType(x))); this.Ships = new MasterTable<ShipInfo>(start2.api_mst_ship.Select(x => new ShipInfo(x))); this.SlotItems = new MasterTable<SlotItemInfo>(start2.api_mst_slotitem.Select(x => new SlotItemInfo(x))); this.UseItems = new MasterTable<UseItemInfo>(start2.api_mst_useitem.Select(x => new UseItemInfo(x))); }
public void Initialize() { KanColleClient.Current.Proxy.api_start2.TryParse<kcsapi_start2>().Subscribe(x => { RawStart2 = x.Data; Models.Repositories.Master.Current.Update(x.Data); }); ResourceWriter = new KcsResourceWriter(); SortieListener = new SortieDataListener(); }
internal Master(kcsapi_start2 start2) { this.ShipTypes = new MasterTable<ShipType>(start2.api_mst_stype.Select(x => new ShipType(x))); this.Ships = new MasterTable<ShipInfo>(start2.api_mst_ship.Select(x => new ShipInfo(x))); this.SlotItems = new MasterTable<SlotItemInfo>(start2.api_mst_slotitem.Select(x => new SlotItemInfo(x))); this.UseItems = new MasterTable<UseItemInfo>(start2.api_mst_useitem.Select(x => new UseItemInfo(x))); this.Missions = new MasterTable<Mission>(start2.api_mst_mission.Select(x => new Mission(x))); this.MapAreas = new MasterTable<MapArea>(start2.api_mst_maparea.Select(x => new MapArea(x))); this.MapInfos = new MasterTable<MapInfo>(start2.api_mst_mapinfo.Select(x => new MapInfo(x, this.MapAreas))); }
public void Update(kcsapi_start2 start2) { var areas = start2.api_mst_maparea.Select(x => new MapArea(x)).ToDictionary(x => x.Id, x => x); var infos = start2.api_mst_mapinfo.Select(x => new MapInfo(x)).ToDictionary(x => x.Id, x => x); var cells = start2.api_mst_mapcell.Select(x => new MapCell(x)).ToDictionary(x => x.Id, x => x); foreach (var key in areas.Keys) this.MapAreas.AddOrUpdate(key, areas[key], (k, v) => areas[k]); foreach (var key in infos.Keys) this.MapInfos.AddOrUpdate(key, infos[key], (k, v) => infos[k]); foreach (var key in cells.Keys) this.MapCells.AddOrUpdate(key, cells[key], (k, v) => cells[k]); this.Save(); }
public void Initialize() { FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest; KanColleClient.Current.Proxy.api_start2.TryParse<kcsapi_start2>().Subscribe(x => initData = x.Data); KanColleClient.Current.Proxy.api_get_member_basic.TryParse<kcsapi_basic>().Subscribe(x => fcoin = x.Data.api_fcoin); if (!File.Exists(Directory.GetCurrentDirectory() + @"\Plugins\picture_book_ext.dat")) { var res = new byte[Resources.picture_book_ext.Length]; Resources.picture_book_ext.CopyTo(res, 0); var fs = new FileStream(Directory.GetCurrentDirectory() + @"\Plugins\picture_book_ext.dat", FileMode.Create, FileAccess.Write); fs.Write(res, 0, res.Length); fs.Close(); } }
public ShipItemCollection(kcsapi_start2 initData, int beginNo, int endNo) { var list = new List<ShipItem>(); initData.api_mst_ship.Where(x => x.api_sortno >= beginNo && x.api_sortno <= endNo).ToList() .ForEach(x => { var ship = new ShipItem(x); initData.api_mst_ship.Where(y => y.api_id >= 900 && y.api_yomi == x.api_yomi).ToList() // 查找节日立绘 .ForEach(y => ship.AddGraph(y.api_id)); list.Add(ship); }); this.api_list = list.Count > 0 ? list.ToArray() : null; }
public static ShipBookData Generate(kcsapi_start2 initData, int beginNo, int endNo) { return new ShipBookData { api_result = 1, api_result_msg = @"\u6210\u529f", api_data = new ShipItemCollection(initData, beginNo, endNo) }; }
public EquipmentItemCollection(kcsapi_start2 initData, int beginNo, int endNo) { var list = new List<EquipmentItem>(); initData.api_mst_slotitem.Where(x => x.api_sortno >= beginNo && x.api_sortno <= endNo).ToList() .ForEach(x => list.Add(new EquipmentItem(x))); this.api_list = list.Count > 0 ? list.ToArray() : null; }
public void Update(kcsapi_start2 start2) { var mapAreas = start2.api_mst_maparea.Select(x => new MapArea(x)).ToDictionary(x => x.Id, x => x); var mapInfos = start2.api_mst_mapinfo.Select(x => new MapInfo(x)).ToDictionary(x => x.Id, x => x); this.MapAreas = this.MapAreas.Merge(mapAreas); this.MapInfos = this.MapInfos.Merge(mapInfos); this.Serialize(this.filePath); }