From 3f45ed478c0c7f25c12af20dabc6f0e6a12706e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=82=8B=E3=81=A8?= Date: Fri, 19 Feb 2016 19:50:46 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E8=89=A6=E5=A8=98=E4=B8=80=E8=A6=A7?= =?UTF-8?q?=E3=82=A6=E3=82=A4=E3=83=B3=E3=83=89=E3=82=A6=E3=81=ABcondition?= =?UTF-8?q?=E5=80=A4=E3=81=AB=E3=82=88=E3=82=8B=E3=83=95=E3=82=A3=E3=83=AB?= =?UTF-8?q?=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/Catalogs/ShipCatalogFilter.cs | 78 +++++++++++++++++++ .../Catalogs/ShipCatalogWindowViewModel.cs | 5 +- .../Views/Catalogs/ShipCatalogWindow.xaml | 24 +++++- 3 files changed, 105 insertions(+), 2 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogFilter.cs b/source/Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogFilter.cs index a00cca9f4..0eb89394a 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogFilter.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogFilter.cs @@ -681,4 +681,82 @@ public override bool Predicate(Ship ship) return false; } } + + public class ShipConditionFilter : ShipCatalogFilter + { + #region Both 変更通知プロパティ + + private bool _Both; + + public bool Both + { + get { return this._Both; } + set + { + if (this._Both != value) + { + this._Both = value; + this.RaisePropertyChanged(); + this.Update(); + } + } + } + + #endregion + + #region Brilliant 変更通知プロパティ + + private bool _Brilliant; + + public bool Brilliant + { + get { return this._Brilliant; } + set + { + if (this._Brilliant != value) + { + this._Brilliant = value; + this.RaisePropertyChanged(); + this.Update(); + } + } + } + + #endregion + + #region Unbrilliant 変更通知プロパティ + + private bool _Unbrilliant; + + public bool Unbrilliant + { + get { return this._Unbrilliant; } + set + { + if (this._Unbrilliant != value) + { + this._Unbrilliant = value; + this.RaisePropertyChanged(); + this.Update(); + } + } + } + + #endregion + + public ShipConditionFilter(Action updateAction) + : base(updateAction) + { + this._Both = true; + } + + public override bool Predicate(Ship ship) + { + if (this.Both) return true; + if (this.Brilliant && ship.ConditionType == ConditionType.Brilliant) return true; + if (this.Unbrilliant && ship.ConditionType >= ConditionType.Normal) return true; + + return false; + } + } } diff --git a/source/Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogWindowViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogWindowViewModel.cs index 67716d27c..7bee84b78 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogWindowViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogWindowViewModel.cs @@ -31,6 +31,7 @@ public class ShipCatalogWindowViewModel : WindowViewModel public ShipExpeditionFilter ShipExpeditionFilter { get; } public ShipSallyAreaFilter ShipSallyAreaFilter { get; } public ShipDamagedFilter ShipDamagedFilter { get; } + public ShipConditionFilter ShipConditionFilter { get; } public bool CheckAllShipTypes { @@ -143,6 +144,7 @@ public ShipCatalogWindowViewModel() this.ShipExpeditionFilter = new ShipExpeditionFilter(this.Update); this.ShipSallyAreaFilter = new ShipSallyAreaFilter(this.Update); this.ShipDamagedFilter = new ShipDamagedFilter(this.Update); + this.ShipConditionFilter = new ShipConditionFilter(this.Update); this.updateSource .Do(_ => this.IsReloading = true) @@ -179,7 +181,8 @@ private IObservable UpdateAsync(SallyArea[] areas) .Where(this.ShipRemodelingFilter.Predicate) .Where(this.ShipExpeditionFilter.Predicate) .Where(this.ShipSallyAreaFilter.Predicate) - .Where(this.ShipDamagedFilter.Predicate); + .Where(this.ShipDamagedFilter.Predicate) + .Where(this.ShipConditionFilter.Predicate); this.Ships = this.SortWorker.Sort(list) .Select((x, i) => new ShipViewModel(i + 1, x, areas.FirstOrDefault(y => y.Area == x.SallyArea))) diff --git a/source/Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml b/source/Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml index 9edc588fa..447892196 100644 --- a/source/Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml @@ -247,7 +247,7 @@ @@ -407,6 +407,28 @@ IsChecked="{Binding Undamaged, Mode=TwoWay}" /> + + + + + + + + + + + + + + + + + From 4492aacc9b0b886dd81ef5e4c5346fb232a5c5f5 Mon Sep 17 00:00:00 2001 From: Manato KAMEYA Date: Fri, 1 Apr 2016 20:33:08 +0900 Subject: [PATCH 2/2] =?UTF-8?q?4=20=E6=9C=88=201=20=E6=97=A5=E3=82=A2?= =?UTF-8?q?=E3=83=83=E3=83=97=E3=83=87=E3=83=BC=E3=83=88=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Properties/AssemblyInfo.cs | 2 +- .../KanColleClient.cs | 16 +++++++++------- .../KanColleProxy.Endpoints.cs | 8 ++++++++ .../KanColleProxy.Endpoints.tt | 1 + .../KanColleWrapper.csproj | 1 + .../Models/Raw/kcsapi_require_info.cs | 18 ++++++++++++++++++ .../Models/Raw/kcsapi_start2.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Grabacr07.Tools.JsonViewer/App.config | 4 ++-- .../JsonViewer.csproj | 2 +- 10 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_require_info.cs diff --git a/source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs b/source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs index fda367d66..2e8eb1ee8 100644 --- a/source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs +++ b/source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs @@ -15,4 +15,4 @@ ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] -[assembly: AssemblyVersion("4.2.3.0")] +[assembly: AssemblyVersion("4.2.4.0")] diff --git a/source/Grabacr07.KanColleWrapper/KanColleClient.cs b/source/Grabacr07.KanColleWrapper/KanColleClient.cs index bfe39327b..4acbeccae 100644 --- a/source/Grabacr07.KanColleWrapper/KanColleClient.cs +++ b/source/Grabacr07.KanColleWrapper/KanColleClient.cs @@ -100,14 +100,15 @@ private KanColleClient() public void Initialieze() { var proxy = this.Proxy ?? (this.Proxy = new KanColleProxy()); - var basic = proxy.api_get_member_basic.TryParse().FirstAsync().ToTask(); - var kdock = proxy.api_get_member_kdock.TryParse().FirstAsync().ToTask(); - var sitem = proxy.api_get_member_slot_item.TryParse().FirstAsync().ToTask(); + var requireInfo = proxy.api_get_member_require_info.TryParse().FirstAsync().ToTask(); + //var basic = proxy.api_get_member_basic.TryParse().FirstAsync().ToTask(); + //var kdock = proxy.api_get_member_kdock.TryParse().FirstAsync().ToTask(); + //var sitem = proxy.api_get_member_slot_item.TryParse().FirstAsync().ToTask(); proxy.api_start2.FirstAsync().Subscribe(async session => { var timeout = Task.Delay(TimeSpan.FromSeconds(20)); - var canInitialize = await Task.WhenAny(new Task[] { basic, kdock, sitem }.WhenAll(), timeout) != timeout; + var canInitialize = await Task.WhenAny(new Task[] { requireInfo }.WhenAll(), timeout) != timeout; // タイムアウト仕掛けてるのは、今後のアップデートで basic, kdock, slot_item のいずれかが来なくなったときに // 起動できなくなる (IsStarted を true にできなくなる) のを防ぐため @@ -122,9 +123,10 @@ public void Initialieze() if (canInitialize) { - this.Homeport.UpdateAdmiral((await basic).Data); - this.Homeport.Itemyard.Update((await sitem).Data); - this.Homeport.Dockyard.Update((await kdock).Data); + var data = await requireInfo; + this.Homeport.UpdateAdmiral(data.Data.api_basic); + this.Homeport.Itemyard.Update(data.Data.api_slot_item); + this.Homeport.Dockyard.Update(data.Data.api_kdock); } this.IsStarted = true; diff --git a/source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.cs b/source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.cs index 8c946dd5b..118a2c0fc 100644 --- a/source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.cs +++ b/source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.cs @@ -350,5 +350,13 @@ public IObservable api_req_combined_battle_goback_port get { return this.ApiSessionSource.Where(x => x.Request.PathAndQuery == "/kcsapi/api_req_combined_battle/goback_port"); } } + /// + /// エンド ポイント "/kcsapi/api_get_member/require_info" からのセッションを配信します。 + /// + public IObservable api_get_member_require_info + { + get { return this.ApiSessionSource.Where(x => x.Request.PathAndQuery == "/kcsapi/api_get_member/require_info"); } + } + } } diff --git a/source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.tt b/source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.tt index 6d44484ff..b889642b7 100644 --- a/source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.tt +++ b/source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.tt @@ -50,6 +50,7 @@ "/kcsapi/api_req_combined_battle/airbattle", "/kcsapi/api_req_combined_battle/battleresult", "/kcsapi/api_req_combined_battle/goback_port", + "/kcsapi/api_get_member/require_info", }; #> // diff --git a/source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj b/source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj index 99fb412f3..a3d67fc32 100644 --- a/source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj +++ b/source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj @@ -117,6 +117,7 @@ + diff --git a/source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_require_info.cs b/source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_require_info.cs new file mode 100644 index 000000000..34a57097a --- /dev/null +++ b/source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_require_info.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Grabacr07.KanColleWrapper.Models.Raw +{ + public class kcsapi_require_info + { + public kcsapi_basic api_basic { get; set; } + public kcsapi_slotitem[] api_slot_item { get; set; } + //public Api_Unsetslot api_unsetslot { get; set; } + public kcsapi_kdock[] api_kdock { get; set; } + public kcsapi_useitem[] api_useitem { get; set; } + //public Api_Furniture[] api_furniture { get; set; } + } +} diff --git a/source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_start2.cs b/source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_start2.cs index 2a55f9794..729f59846 100644 --- a/source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_start2.cs +++ b/source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_start2.cs @@ -97,7 +97,7 @@ public class Api_Mst_Shipgraph public int api_id { get; set; } public int api_sortno { get; set; } public string api_filename { get; set; } - public string api_version { get; set; } + //public string api_version { get; set; } public int[] api_boko_n { get; set; } public int[] api_boko_d { get; set; } public int[] api_kaisyu_n { get; set; } @@ -228,7 +228,7 @@ public class Api_Mst_Furnituregraph public int api_type { get; set; } public int api_no { get; set; } public string api_filename { get; set; } - public string api_version { get; set; } + //public string api_version { get; set; } } public class Api_Mst_Useitem diff --git a/source/Grabacr07.KanColleWrapper/Properties/AssemblyInfo.cs b/source/Grabacr07.KanColleWrapper/Properties/AssemblyInfo.cs index 8d6ac266b..766a2ab93 100644 --- a/source/Grabacr07.KanColleWrapper/Properties/AssemblyInfo.cs +++ b/source/Grabacr07.KanColleWrapper/Properties/AssemblyInfo.cs @@ -10,5 +10,5 @@ [assembly: ComVisible(false)] [assembly: Guid("8A13AB28-4E9F-423D-80AD-23EEF2821959")] -[assembly: AssemblyVersion("1.5.0")] -[assembly: AssemblyInformationalVersion("1.5.0")] +[assembly: AssemblyVersion("1.5.1")] +[assembly: AssemblyInformationalVersion("1.5.1")] diff --git a/source/Tools/Grabacr07.Tools.JsonViewer/App.config b/source/Tools/Grabacr07.Tools.JsonViewer/App.config index b71194fb8..deaa9e274 100644 --- a/source/Tools/Grabacr07.Tools.JsonViewer/App.config +++ b/source/Tools/Grabacr07.Tools.JsonViewer/App.config @@ -1,6 +1,6 @@ - + - + diff --git a/source/Tools/Grabacr07.Tools.JsonViewer/JsonViewer.csproj b/source/Tools/Grabacr07.Tools.JsonViewer/JsonViewer.csproj index 996449abb..618b865d0 100644 --- a/source/Tools/Grabacr07.Tools.JsonViewer/JsonViewer.csproj +++ b/source/Tools/Grabacr07.Tools.JsonViewer/JsonViewer.csproj @@ -9,7 +9,7 @@ Properties Grabacr07.Tools.JsonViewer Grabacr07.Tools.JsonViewer - v4.5 + v4.6 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4