diff --git a/source/Grabacr07.KanColleViewer/KanColleViewer.csproj b/source/Grabacr07.KanColleViewer/KanColleViewer.csproj index b84579b25..4f56a09c6 100644 --- a/source/Grabacr07.KanColleViewer/KanColleViewer.csproj +++ b/source/Grabacr07.KanColleViewer/KanColleViewer.csproj @@ -37,6 +37,7 @@ prompt 4 false + false AnyCPU @@ -85,8 +86,8 @@ ..\packages\Nekoxy.1.5.2.20\lib\net45\Nekoxy.dll True - - ..\packages\StatefulModel.0.5.0\lib\portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10\StatefulModel.dll + + ..\packages\StatefulModel.0.6.0\lib\portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10\StatefulModel.dll True @@ -627,6 +628,21 @@ PreserveNewest + + + Always + + + False + license.txt + Always + + + False + Licenses\%(FileName)%(Extension) + Always + + {3050F1C5-98B5-11CF-BB82-00AA00BDCE0B} @@ -647,22 +663,6 @@ True - - - Always - - - False - license.txt - Always - - - False - Licenses\%(FileName)%(Extension) - Always - - - + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml index 34da0a244..97937a4b3 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml @@ -79,16 +79,16 @@ Style="{DynamicResource DetailTextStyleKey}"/> - - - diff --git a/source/Grabacr07.KanColleViewer/packages.config b/source/Grabacr07.KanColleViewer/packages.config index 8a366094e..437a66756 100644 --- a/source/Grabacr07.KanColleViewer/packages.config +++ b/source/Grabacr07.KanColleViewer/packages.config @@ -11,5 +11,5 @@ - + \ No newline at end of file diff --git a/source/Grabacr07.KanColleViewer/readme.txt b/source/Grabacr07.KanColleViewer/readme.txt index f54ef0bdf..17d423892 100644 --- a/source/Grabacr07.KanColleViewer/readme.txt +++ b/source/Grabacr07.KanColleViewer/readme.txt @@ -1,6 +1,6 @@ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 提督業も忙しい! (KanColleViewer) - version 4.2.1 2016/02/12 + version 4.2.6 2016/06/20 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -167,6 +167,8 @@ Desktop Toast ■更新履歴 +2016/06/20 - version 4.2.6 リリース + (わすれました) 2016/02/12 - version 4.2.1 リリース 2016/02/08 - version 4.2 リリース 2015/11/10 - version 4.1.6 リリース diff --git a/source/Grabacr07.KanColleWrapper/Calculator.cs b/source/Grabacr07.KanColleWrapper/Calculator.cs index 8abb31095..6a8bee0f1 100644 --- a/source/Grabacr07.KanColleWrapper/Calculator.cs +++ b/source/Grabacr07.KanColleWrapper/Calculator.cs @@ -8,146 +8,6 @@ namespace Grabacr07.KanColleWrapper { internal static class Calculator { - #region 制空値計算 - - /// - /// 装備と搭載数を指定して、スロット単位の制空能力を計算します。 - /// - /// 対空能力を持つ装備。 - /// 搭載数。 - /// - public static int CalcAirSuperiorityPotential(this SlotItem slotItem, int onslot) - { - if (slotItem.Info.IsAirSuperiorityFighter) - { - return (int)(slotItem.Info.AA * Math.Sqrt(onslot)); - } - - return 0; - } - /// - /// 指定した艦の制空能力を計算します。 - /// - public static int CalcAirSuperiorityPotential(this Ship ship) - { - return ship.EquippedItems - .Select(x => x.Item.CalcAirSuperiorityPotential(x.Current)) - .Sum(); - } - - /// - /// 指定した艦の制空能力の最小値を計算します。 - /// - public static int CalcMinAirSuperiorityPotential(this Ship ship) - { - return ship.EquippedItems - .Select(x => (x.Item.Info.Type == SlotItemType.艦上戦闘機 - || x.Item.Info.Type == SlotItemType.水上戦闘機 - ? x.Item.CalcAirSuperiorityPotential(x.Current) - : 0) - + x.Item.CalcMinAirecraftAdeptBonus(x.Current)) - .Select(x => (int)x) - .Sum(); - } - - /// - /// 指定した艦の制空能力の最大値を計算します。 - /// - public static int CalcMaxAirSuperiorityPotential(this Ship ship) - { - return ship.EquippedItems - .Select(x => x.Item.CalcAirSuperiorityPotential(x.Current) - + x.Item.CalcMaxAirecraftAdeptBonus(x.Current)) - .Select(x => (int)x) - .Sum(); - } - - /// - /// 熟練度による制空能力ボーナス最小値を計算します。 - /// - /// 対空能力を持つ装備。 - /// 搭載数。 - /// - private static double CalcMinAirecraftAdeptBonus(this SlotItem slotItem, int onslot) - { - if(onslot < 1) return 0; - return slotItem.Info.Type == SlotItemType.艦上戦闘機 - || slotItem.Info.Type == SlotItemType.水上戦闘機 - ? slotItem.CalcAirecraftAdeptBonusOfType() + slotItem.CalcMinInternalAirecraftAdeptBonus() - : 0; // 艦戦・水戦以外は簡単に吹き飛ぶので最小値としては計算に入れない - } - - /// - /// 熟練度による制空能力ボーナス最大値を計算します。 - /// - /// 対空能力を持つ装備。 - /// 搭載数。 - /// - private static double CalcMaxAirecraftAdeptBonus(this SlotItem slotItem, int onslot) - => onslot < 1 ? 0 - : slotItem.CalcAirecraftAdeptBonusOfType() + slotItem.CalcMaxInternalAirecraftAdeptBonus(); - - /// - /// 各表記熟練度に対応した機種別熟練度ボーナスを計算します。 - /// - /// - /// - private static int CalcAirecraftAdeptBonusOfType(this SlotItem slotItem) - => slotItem.Info.Type == SlotItemType.艦上戦闘機 - || slotItem.Info.Type == SlotItemType.水上戦闘機 - ? slotItem.Adept == 1 ? 0 - : slotItem.Adept == 2 ? 2 - : slotItem.Adept == 3 ? 5 - : slotItem.Adept == 4 ? 9 - : slotItem.Adept == 5 ? 14 - : slotItem.Adept == 6 ? 14 - : slotItem.Adept == 7 ? 22 - : 0 // Adept == 0 - : slotItem.Info.Type == SlotItemType.水上爆撃機 - ? slotItem.Adept == 1 ? 0 - : slotItem.Adept == 2 ? 1 - : slotItem.Adept == 3 ? 1 - : slotItem.Adept == 4 ? 1 - : slotItem.Adept == 5 ? 3 - : slotItem.Adept == 6 ? 3 - : slotItem.Adept == 7 ? 6 - : 0 // Adept == 0 - : 0; - - /// - /// 各表記熟練度に対応した艦載機内部熟練度ボーナスの最小値を計算します。 - /// - /// - /// - private static double CalcMinInternalAirecraftAdeptBonus(this SlotItem slotItem) - { - return slotItem.Info.IsAirSuperiorityFighter - ? Math.Sqrt((slotItem.Adept != 0 ? (slotItem.Adept - 1) * 15 + 10 : 0) / 10d) - : 0; - } - - /// - /// 各表記熟練度に対応した艦載機内部熟練度ボーナスの最大値を計算します。 - /// - /// - /// - private static double CalcMaxInternalAirecraftAdeptBonus(this SlotItem slotItem) - { - if (!slotItem.Info.IsAirSuperiorityFighter) - return 0; - switch (slotItem.Adept) - { - case 0: - return Math.Sqrt(9d / 10); - case 7: - return Math.Sqrt(120d / 10); - default: - return Math.Sqrt((slotItem.Adept * 15 + 9) / 10d); - } - } - - #endregion - public static double CalcViewRange(this Fleet fleet) { return ViewRangeCalcLogic.Get(KanColleClient.Current.Settings.ViewRangeCalcType).Calc(new[] { fleet }); diff --git a/source/Grabacr07.KanColleWrapper/KanColleClient.cs b/source/Grabacr07.KanColleWrapper/KanColleClient.cs index 7b45cfc58..fb311655e 100644 --- a/source/Grabacr07.KanColleWrapper/KanColleClient.cs +++ b/source/Grabacr07.KanColleWrapper/KanColleClient.cs @@ -3,10 +3,7 @@ using System.Diagnostics; using System.Linq; using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; -using System.Threading; using System.Threading.Tasks; -using Grabacr07.KanColleWrapper.Models; using Grabacr07.KanColleWrapper.Models.Raw; namespace Grabacr07.KanColleWrapper @@ -121,32 +118,38 @@ private KanColleClient() public void Initialieze() { var proxy = this.Proxy ?? (this.Proxy = new KanColleProxy()); - var requireInfoSource = proxy.api_get_member_require_info - .TryParse() - .FirstAsync() - .ToTask(); - proxy.api_start2.FirstAsync().Subscribe(async session => - { - var timeout = Task.Delay(TimeSpan.FromSeconds(20)); - var canInitialize = await Task.WhenAny(requireInfoSource, timeout) != timeout; - - SvData svd; - if (!SvData.TryParse(session, out svd)) return; - - this.Master = new Master(svd.Data); - if (this.Homeport == null) this.Homeport = new Homeport(proxy); + var start2Source = proxy.api_start2.TryParse(); + var requireInfoSource = proxy.api_get_member_require_info.TryParse(); + var firstTime = start2Source + .CombineLatest(requireInfoSource, (start2, requireInfo) => new { start2, requireInfo, }) + .FirstAsync(); - if (canInitialize) - { - var requireInfo = await requireInfoSource; - this.Homeport.UpdateAdmiral(requireInfo.Data.api_basic); - this.Homeport.Itemyard.Update(requireInfo.Data.api_slot_item); - this.Homeport.Dockyard.Update(requireInfo.Data.api_kdock); - } + // Homeport の初期化と require_info の適用に Master のインスタンスが必要なため、初回のみ足並み揃えて実行 + // 2 回目以降は受信したタイミングでそれぞれ更新すればよい + firstTime.Subscribe(x => + { + this.Master = new Master(x.start2.Data); + this.Homeport = new Homeport(proxy); + this.SetRequireInfo(x.requireInfo.Data); this.IsStarted = true; }); + + start2Source + .SkipUntil(firstTime) + .Subscribe(x => this.Master = new Master(x.Data)); + + requireInfoSource + .SkipUntil(firstTime) + .Subscribe(x => this.SetRequireInfo(x.Data)); + } + + private void SetRequireInfo(kcsapi_require_info data) + { + this.Homeport.UpdateAdmiral(data.api_basic); + this.Homeport.Itemyard.Update(data.api_slot_item); + this.Homeport.Dockyard.Update(data.api_kdock); } public void DeferredInit(object sender, IKanColleClientSettings value) diff --git a/source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj b/source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj index a1b478faf..1af5a2eb4 100644 --- a/source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj +++ b/source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj @@ -72,8 +72,8 @@ - - ..\packages\StatefulModel.0.5.0\lib\portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10\StatefulModel.dll + + ..\packages\StatefulModel.0.6.0\lib\portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10\StatefulModel.dll True @@ -109,6 +109,7 @@ + diff --git a/source/Grabacr07.KanColleWrapper/KanColleWrapper.nuspec b/source/Grabacr07.KanColleWrapper/KanColleWrapper.nuspec index 0ccc04856..8f26fbb85 100644 --- a/source/Grabacr07.KanColleWrapper/KanColleWrapper.nuspec +++ b/source/Grabacr07.KanColleWrapper/KanColleWrapper.nuspec @@ -15,7 +15,7 @@ - + diff --git a/source/Grabacr07.KanColleWrapper/Models/AirSuperiorityPotential.cs b/source/Grabacr07.KanColleWrapper/Models/AirSuperiorityPotential.cs new file mode 100644 index 000000000..d1e850378 --- /dev/null +++ b/source/Grabacr07.KanColleWrapper/Models/AirSuperiorityPotential.cs @@ -0,0 +1,192 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Grabacr07.KanColleWrapper.Models +{ + [Flags] + public enum AirSuperiorityCalculationOptions + { + Default = Maximum, + + Minimum = InternalProficiencyMinValue | Fighter, + Maximum = InternalProficiencyMaxValue | Fighter | Attacker | SeaplaneBomber, + + /// 艦上戦闘機、水上戦闘機。 + Fighter = 0x0001, + + /// 艦上攻撃機、艦上爆撃機。 + Attacker = 0x0002, + + /// 水上爆撃機。 + SeaplaneBomber = 0x0004, + + /// 内部熟練度最小値による計算。 + InternalProficiencyMinValue = 0x0100, + + /// 内部熟練度最大値による計算。 + InternalProficiencyMaxValue = 0x0200, + } + + public static class AirSuperiorityPotential + { + /// + /// 艦娘の制空能力を計算します。 + /// + public static int GetAirSuperiorityPotential(this Ship ship, AirSuperiorityCalculationOptions options = AirSuperiorityCalculationOptions.Default) + { + return ship.EquippedItems + .Select(x => GetAirSuperiorityPotential(x.Item, x.Current, options)) + .Sum(); + } + + /// + /// 装備と搭載数を指定して、スロット単位の制空能力を計算します。 + /// + public static int GetAirSuperiorityPotential(this SlotItem slotItem, int onslot, AirSuperiorityCalculationOptions options = AirSuperiorityCalculationOptions.Default) + { + var calculator = slotItem.GetCalculator(); + return options.HasFlag(calculator.Options) && onslot >= 1 + ? calculator.GetAirSuperiority(slotItem, onslot, options) + : 0; + } + + private static AirSuperiorityCalculator GetCalculator(this SlotItem slotItem) + { + switch (slotItem.Info.Type) + { + case SlotItemType.艦上戦闘機: + case SlotItemType.水上戦闘機: + return new FighterCalculator(); + + case SlotItemType.艦上攻撃機: + case SlotItemType.艦上爆撃機: + return new AttackerCalculator(); + + case SlotItemType.水上爆撃機: + return new SeaplaneBomberCalculator(); + + default: + return EmptyCalculator.Instance; + } + } + + private abstract class AirSuperiorityCalculator + { + public abstract AirSuperiorityCalculationOptions Options { get; } + + public int GetAirSuperiority(SlotItem slotItem, int onslot, AirSuperiorityCalculationOptions options) + { + // 装備の対空値とスロットの搭載数による制空値 + var airSuperiority = this.GetAirSuperiority(slotItem, onslot); + + // 装備の熟練度による制空値ボーナス + airSuperiority += this.GetProficiencyBonus(slotItem, options); + + return (int)airSuperiority; + } + + protected virtual double GetAirSuperiority(SlotItem slotItem, int onslot) + { + return slotItem.Info.AA * Math.Sqrt(onslot); + } + + protected abstract double GetProficiencyBonus(SlotItem slotItem, AirSuperiorityCalculationOptions options); + } + + #region AirSuperiorityCalculator 派生型 + + private class FighterCalculator : AirSuperiorityCalculator + { + public override AirSuperiorityCalculationOptions Options => AirSuperiorityCalculationOptions.Fighter; + + protected override double GetAirSuperiority(SlotItem slotItem, int onslot) + { + // 装備改修による対空値加算 (★ x 0.2) + return (slotItem.Info.AA + slotItem.Level * 0.2) * Math.Sqrt(onslot); + } + + protected override double GetProficiencyBonus(SlotItem slotItem, AirSuperiorityCalculationOptions options) + { + var proficiency = slotItem.GetProficiency(); + return Math.Sqrt(proficiency.GetInternalValue(options) / 10.0) + proficiency.FighterBonus; + } + } + + private class AttackerCalculator : AirSuperiorityCalculator + { + public override AirSuperiorityCalculationOptions Options => AirSuperiorityCalculationOptions.Attacker; + + protected override double GetProficiencyBonus(SlotItem slotItem, AirSuperiorityCalculationOptions options) + { + var proficiency = slotItem.GetProficiency(); + return Math.Sqrt(proficiency.GetInternalValue(options) / 10.0); + } + } + + private class SeaplaneBomberCalculator : AirSuperiorityCalculator + { + public override AirSuperiorityCalculationOptions Options => AirSuperiorityCalculationOptions.SeaplaneBomber; + + protected override double GetProficiencyBonus(SlotItem slotItem, AirSuperiorityCalculationOptions options) + { + var proficiency = slotItem.GetProficiency(); + return Math.Sqrt(proficiency.GetInternalValue(options) / 10.0) + proficiency.SeaplaneBomberBonus; + } + } + + private class EmptyCalculator : AirSuperiorityCalculator + { + public static EmptyCalculator Instance { get; } = new EmptyCalculator(); + + public override AirSuperiorityCalculationOptions Options => ~AirSuperiorityCalculationOptions.Default; + protected override double GetAirSuperiority(SlotItem slotItem, int onslot) => .0; + protected override double GetProficiencyBonus(SlotItem slotItem, AirSuperiorityCalculationOptions options) => .0; + + private EmptyCalculator() { } + } + + #endregion + + private class Proficiency + { + private readonly int internalMinValue; + private readonly int internalMaxValue; + + public int FighterBonus { get; } + public int SeaplaneBomberBonus { get; } + + public Proficiency(int internalMin, int internalMax, int fighterBonus, int seaplaneBomberBonus) + { + this.internalMinValue = internalMin; + this.internalMaxValue = internalMax; + this.FighterBonus = fighterBonus; + this.SeaplaneBomberBonus = seaplaneBomberBonus; + } + + /// + /// 内部熟練度値を取得します。 + /// + public int GetInternalValue(AirSuperiorityCalculationOptions options) + { + if (options.HasFlag(AirSuperiorityCalculationOptions.InternalProficiencyMinValue)) return this.internalMinValue; + if (options.HasFlag(AirSuperiorityCalculationOptions.InternalProficiencyMaxValue)) return this.internalMaxValue; + return (this.internalMaxValue + this.internalMinValue) / 2; // <- めっちゃ適当 + } + } + + private static readonly Dictionary proficiencies = new Dictionary() + { + { 0, new Proficiency(0, 9, 0, 0) }, + { 1, new Proficiency(10, 24, 0, 0) }, + { 2, new Proficiency(25, 39, 2, 1) }, + { 3, new Proficiency(40, 54, 5, 1) }, + { 4, new Proficiency(55, 69, 9, 1) }, + { 5, new Proficiency(70, 84, 14, 3) }, + { 6, new Proficiency(85, 99, 14, 3) }, + { 7, new Proficiency(100, 120, 22, 6) }, + }; + + private static Proficiency GetProficiency(this SlotItem slotItem) => proficiencies[Math.Max(Math.Min(slotItem.Proficiency, 7), 0)]; + } +} diff --git a/source/Grabacr07.KanColleWrapper/Models/FleetState.cs b/source/Grabacr07.KanColleWrapper/Models/FleetState.cs index 54d033878..84f50333d 100644 --- a/source/Grabacr07.KanColleWrapper/Models/FleetState.cs +++ b/source/Grabacr07.KanColleWrapper/Models/FleetState.cs @@ -60,28 +60,6 @@ private set #endregion - #region AirSuperiorityPotential 変更通知プロパティ - - private double _AirSuperiorityPotential; - - /// - /// 艦隊の制空能力を取得します。 - /// - public double AirSuperiorityPotential - { - get { return this._AirSuperiorityPotential; } - private set - { - if (this._AirSuperiorityPotential != value) - { - this._AirSuperiorityPotential = value; - this.RaisePropertyChanged(); - } - } - } - - #endregion - #region MinAirSuperiorityPotential 変更通知プロパティ private double _MinAirSuperiorityPotential; @@ -257,9 +235,8 @@ public void Calculate() this.TotalLevel = ships.HasItems() ? ships.Sum(x => x.Level) : 0; this.AverageLevel = ships.HasItems() ? (double)this.TotalLevel / ships.Length : 0.0; - this.AirSuperiorityPotential = firstFleetShips.Sum(s => s.CalcAirSuperiorityPotential()); - this.MinAirSuperiorityPotential = firstFleetShips.Sum(s => s.CalcMinAirSuperiorityPotential()); - this.MaxAirSuperiorityPotential = firstFleetShips.Sum(s => s.CalcMaxAirSuperiorityPotential()); + this.MinAirSuperiorityPotential = firstFleetShips.Sum(x => x.GetAirSuperiorityPotential(AirSuperiorityCalculationOptions.Minimum)); + this.MaxAirSuperiorityPotential = firstFleetShips.Sum(x => x.GetAirSuperiorityPotential(AirSuperiorityCalculationOptions.Maximum)); this.Speed = ships.All(x => x.Info.Speed == ShipSpeed.Fast) ? FleetSpeed.Fast : ships.All(x => x.Info.Speed == ShipSpeed.Low) diff --git a/source/Grabacr07.KanColleWrapper/Models/QuestType.cs b/source/Grabacr07.KanColleWrapper/Models/QuestType.cs index 95cfbb8d4..bf7d41d95 100644 --- a/source/Grabacr07.KanColleWrapper/Models/QuestType.cs +++ b/source/Grabacr07.KanColleWrapper/Models/QuestType.cs @@ -10,34 +10,29 @@ namespace Grabacr07.KanColleWrapper.Models /// public enum QuestType { - /// - /// 1 回のみの任務。 - /// - OneTime = 1, - /// /// デイリー任務。 /// - Daily = 2, + Daily = 1, /// /// ウィークリー任務。 /// - Weekly = 3, + Weekly = 2, /// - /// 日付の一の位が3,7,0の日のみ出現する任務。 + /// マンスリー任務。 /// - X3X7X0 = 4, + Monthly = 3, /// - /// 日付の一の位が2,8の日のみ出現する任務。 + /// 1 回のみの任務。 /// - X2X8 = 5, + OneTime = 4, /// - /// マンスリー任務。 + /// その他。 /// - Monthly = 6, + Other = 5, } } diff --git a/source/Grabacr07.KanColleWrapper/Models/Ship.cs b/source/Grabacr07.KanColleWrapper/Models/Ship.cs index 07cf0fb46..d73c0a57e 100644 --- a/source/Grabacr07.KanColleWrapper/Models/Ship.cs +++ b/source/Grabacr07.KanColleWrapper/Models/Ship.cs @@ -312,6 +312,8 @@ public TimeSpan TimeToRepair /// public int ViewRange => this.RawData.api_sakuteki.Get(0) ?? 0; + public int ASW => this.RawData.api_taisen.Get(0) ?? 0; + public LimitedValue AntiSub { get; private set; } public LimitedValue Evasion { get; private set; } diff --git a/source/Grabacr07.KanColleWrapper/Models/SlotItem.cs b/source/Grabacr07.KanColleWrapper/Models/SlotItem.cs index cecee0943..a2a625a3d 100644 --- a/source/Grabacr07.KanColleWrapper/Models/SlotItem.cs +++ b/source/Grabacr07.KanColleWrapper/Models/SlotItem.cs @@ -16,11 +16,11 @@ public class SlotItem : RawDataWrapper, IIdentifiable public string LevelText => this.Level >= 10 ? "★max" : this.Level >= 1 ? ("★+" + this.Level) : ""; - public string NameWithLevel => $"{this.Info.Name}{(this.Level >= 1 ? (" " + this.LevelText) : "")}{(this.Adept >= 1 ? (" " + this.AdeptText) : "")}"; + public string NameWithLevel => $"{this.Info.Name}{(this.Level >= 1 ? (" " + this.LevelText) : "")}{(this.Proficiency >= 1 ? (" " + this.ProficiencyText) : "")}"; - public int Adept => this.RawData.api_alv; + public int Proficiency => this.RawData.api_alv; - public string AdeptText => this.Adept >= 1 ? (" (熟練度 " + this.Adept + ")") : ""; + public string ProficiencyText => this.Proficiency >= 1 ? (" (熟練度 " + this.Proficiency + ")") : ""; internal SlotItem(kcsapi_slotitem rawData) : base(rawData) @@ -40,7 +40,7 @@ public void Remodel(int level, int masterId) public override string ToString() { - return $"ID = {this.Id}, Name = \"{this.Info.Name}\", Level = {this.Level}, Adapt = {this.Adept}"; + return $"ID = {this.Id}, Name = \"{this.Info.Name}\", Level = {this.Level}, Proficiency = {this.Proficiency}"; } diff --git a/source/Grabacr07.KanColleWrapper/Models/SlotItemInfo.cs b/source/Grabacr07.KanColleWrapper/Models/SlotItemInfo.cs index 42371c567..8cc583442 100644 --- a/source/Grabacr07.KanColleWrapper/Models/SlotItemInfo.cs +++ b/source/Grabacr07.KanColleWrapper/Models/SlotItemInfo.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; -using System.Diagnostics; +using System.ComponentModel; using System.Linq; -using System.Text; using System.Threading.Tasks; using Grabacr07.KanColleWrapper.Internal; using Grabacr07.KanColleWrapper.Models.Raw; @@ -94,13 +93,7 @@ public class SlotItemInfo : RawDataWrapper, IIdentifiable || this.Type == SlotItemType.水上爆撃機 || this.Type == SlotItemType.水上戦闘機; - public bool IsNumerable => this.Type == SlotItemType.艦上偵察機 - || this.Type == SlotItemType.艦上戦闘機 - || this.Type == SlotItemType.艦上攻撃機 - || this.Type == SlotItemType.艦上爆撃機 - || this.Type == SlotItemType.水上偵察機 - || this.Type == SlotItemType.水上爆撃機 - || this.Type == SlotItemType.水上戦闘機; + public bool IsNumerable => this.Type.IsNumerable(); public SlotItemEquipType EquipType { get; } @@ -120,12 +113,14 @@ public override string ToString() #region static members - public static SlotItemInfo Dummy { get; } = new SlotItemInfo(new kcsapi_mst_slotitem() - { - api_id = 0, - api_name = "???", - }, new MasterTable()); + public static SlotItemInfo Dummy { get; } = new SlotItemInfo( + new kcsapi_mst_slotitem() + { + api_id = 0, + api_name = "???", + }, + new MasterTable()); - #endregion + #endregion } } diff --git a/source/Grabacr07.KanColleWrapper/Models/SlotItemType.cs b/source/Grabacr07.KanColleWrapper/Models/SlotItemType.cs index 5b9b7007e..104aada4d 100644 --- a/source/Grabacr07.KanColleWrapper/Models/SlotItemType.cs +++ b/source/Grabacr07.KanColleWrapper/Models/SlotItemType.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +// ReSharper disable InconsistentNaming namespace Grabacr07.KanColleWrapper.Models { @@ -59,4 +55,29 @@ public enum SlotItemType 大型電探_II = 93, 艦上偵察機_II = 94, } + + public static class SlotItemTypeExtensions + { + public static bool IsNumerable(this SlotItemType type) + { + switch (type) + { + case SlotItemType.艦上偵察機: + case SlotItemType.艦上偵察機_II: + case SlotItemType.艦上戦闘機: + case SlotItemType.艦上攻撃機: + case SlotItemType.艦上爆撃機: + case SlotItemType.水上偵察機: + case SlotItemType.水上爆撃機: + case SlotItemType.水上戦闘機: + case SlotItemType.オートジャイロ: + case SlotItemType.対潜哨戒機: + case SlotItemType.大型飛行艇: + return true; + + default: + return false; + } + } + } } diff --git a/source/Grabacr07.KanColleWrapper/Models/ViewRange.cs b/source/Grabacr07.KanColleWrapper/Models/ViewRange.cs index 742488bfd..5268daf09 100644 --- a/source/Grabacr07.KanColleWrapper/Models/ViewRange.cs +++ b/source/Grabacr07.KanColleWrapper/Models/ViewRange.cs @@ -221,7 +221,7 @@ public override double Calc(Fleet[] fleets) var itemScore = ships .SelectMany(x => x.EquippedItems) .Select(x => x.Item) - .Sum(x => (x.Info.ViewRange + GetAdeptCoefficient(x)) * GetTypeCoefficient(x.Info.Type)); + .Sum(x => (x.Info.ViewRange + GetLevelCoefficient(x)) * GetTypeCoefficient(x.Info.Type)); var shipScore = ships .Select(x => x.ViewRange - x.EquippedItems.Sum(s => s.Item.Info.RawData.api_saku)) @@ -255,17 +255,17 @@ private Ship[] GetTargetShips(Fleet[] fleets) return new Ship[0]; } - private static double GetAdeptCoefficient(SlotItem item) + private static double GetLevelCoefficient(SlotItem item) { switch (item.Info.Type) { case SlotItemType.水上偵察機: - return Math.Sqrt(item.Adept) * 1.2; + return Math.Sqrt(item.Level) * 1.2; case SlotItemType.小型電探: case SlotItemType.大型電探: case SlotItemType.大型電探_II: - return Math.Sqrt(item.Adept) * 1.25; + return Math.Sqrt(item.Level) * 1.25; default: return 0; diff --git a/source/Grabacr07.KanColleWrapper/Properties/AssemblyInfo.cs b/source/Grabacr07.KanColleWrapper/Properties/AssemblyInfo.cs index 62d964519..601dda8c1 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.2")] -[assembly: AssemblyInformationalVersion("1.5.2")] +[assembly: AssemblyVersion("1.6.0")] +[assembly: AssemblyInformationalVersion("1.6.0")] diff --git a/source/Grabacr07.KanColleWrapper/Quests.cs b/source/Grabacr07.KanColleWrapper/Quests.cs index 0c71f34f3..adea916a7 100644 --- a/source/Grabacr07.KanColleWrapper/Quests.cs +++ b/source/Grabacr07.KanColleWrapper/Quests.cs @@ -14,6 +14,7 @@ using Grabacr07.KanColleWrapper.Internal; using Grabacr07.KanColleWrapper.Models; using Grabacr07.KanColleWrapper.Models.Raw; +using System.Web; namespace Grabacr07.KanColleWrapper { @@ -108,6 +109,7 @@ internal Quests(KanColleProxy proxy) this.All = this.Current = new List(); proxy.api_get_member_questlist + .Where(x => HttpUtility.ParseQueryString(x.Request.BodyAsString)["api_tab_id"] == "0") .Select(Serialize) .Where(x => x != null) .Subscribe(this.Update); diff --git a/source/Grabacr07.KanColleWrapper/packages.config b/source/Grabacr07.KanColleWrapper/packages.config index ea58d5cb9..eb5962a5c 100644 --- a/source/Grabacr07.KanColleWrapper/packages.config +++ b/source/Grabacr07.KanColleWrapper/packages.config @@ -14,5 +14,5 @@ - + \ No newline at end of file diff --git a/source/KanColleViewer.sln.DotSettings b/source/KanColleViewer.sln.DotSettings index d02b631ae..7bb37ce0a 100644 --- a/source/KanColleViewer.sln.DotSettings +++ b/source/KanColleViewer.sln.DotSettings @@ -7,12 +7,17 @@ False True SUGGESTION + DO_NOT_SHOW SUGGESTION SUGGESTION HINT HINT + HINT SUGGESTION SUGGESTION + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW SUGGESTION HINT DO_NOT_SHOW diff --git a/source/MetroRadiance b/source/MetroRadiance index 4e416a846..2b091772a 160000 --- a/source/MetroRadiance +++ b/source/MetroRadiance @@ -1 +1 @@ -Subproject commit 4e416a8461d9fb367f0cffdc7526c40fcf72eda7 +Subproject commit 2b091772a2907172c9b8788a9f8920c0087d098e diff --git a/source/MetroTrilithon b/source/MetroTrilithon index 25bb02e7e..bd31e38ce 160000 --- a/source/MetroTrilithon +++ b/source/MetroTrilithon @@ -1 +1 @@ -Subproject commit 25bb02e7ea2494730498287043ae335c8d555abc +Subproject commit bd31e38ce976fdc7a1689057f3b775fa9cec0f51 diff --git a/source/Plugins/TaskbarProgress/TaskbarProgress.csproj b/source/Plugins/TaskbarProgress/TaskbarProgress.csproj index 3f3b80fb0..28bc36231 100644 --- a/source/Plugins/TaskbarProgress/TaskbarProgress.csproj +++ b/source/Plugins/TaskbarProgress/TaskbarProgress.csproj @@ -42,7 +42,7 @@ True - ..\..\packages\StatefulModel.0.5.0\lib\portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10\StatefulModel.dll + ..\..\packages\StatefulModel.0.6.0\lib\portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10\StatefulModel.dll True diff --git a/source/Plugins/TaskbarProgress/packages.config b/source/Plugins/TaskbarProgress/packages.config index 7c8f44d45..7e88d0938 100644 --- a/source/Plugins/TaskbarProgress/packages.config +++ b/source/Plugins/TaskbarProgress/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file