-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
571 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace RemodelHelper.Models | ||
{ | ||
public class ConsumptionData | ||
{ | ||
public int Lv { get; set; } | ||
public int[] BKit { get; set; } | ||
public int[] RKit { get; set; } | ||
public int CId { get; set; } | ||
public int Count { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Grabacr07.KanColleWrapper.Models; | ||
|
||
namespace RemodelHelper.Models | ||
{ | ||
public class ConsumptionInfo | ||
{ | ||
public int Level { get; internal set; } | ||
|
||
public KitCount BuildKit { get; internal set; } | ||
public KitCount RemodelKit { get; internal set; } | ||
|
||
public SlotItemInfo ConsumeSlotItem { get; internal set; } | ||
public int ConsumeCount { get; internal set; } | ||
} | ||
|
||
public class KitCount | ||
{ | ||
public int Normal { get; internal set; } | ||
public int Ensure { get; internal set; } | ||
|
||
public override string ToString() | ||
{ | ||
var n = this.Normal >= 0 ? this.Normal.ToString() : "-"; | ||
var e = this.Ensure >= 0 ? this.Ensure.ToString() : "-"; | ||
return $"{n}/{e}"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Documents; | ||
using Grabacr07.KanColleWrapper.Models; | ||
|
||
namespace RemodelHelper.Models | ||
{ | ||
public abstract class ItemInfo : IIdentifiable | ||
{ | ||
public int Id => this.Info?.Id ?? 0; | ||
|
||
public SlotItemInfo Info { get; } | ||
|
||
|
||
internal ItemInfo(SlotItemInfo info) | ||
{ | ||
this.Info = info; | ||
} | ||
} | ||
|
||
|
||
public class BaseSlotItemInfo : ItemInfo | ||
{ | ||
public IdentifiableTable<UpgradeSlotItemInfo> UpgradeSlotItems { get; } = new IdentifiableTable<UpgradeSlotItemInfo>(); | ||
|
||
|
||
internal BaseSlotItemInfo(Item item) : base(item.GetBaseSlotInfo()) | ||
{ | ||
this.AddUpgradeSlotItem(item); | ||
} | ||
|
||
internal void AddUpgradeSlotItem(Item item) | ||
{ | ||
if (!this.UpgradeSlotItems.ContainsKey(item.NewId)) | ||
this.UpgradeSlotItems.Add(new UpgradeSlotItemInfo(item)); | ||
else | ||
this.UpgradeSlotItems[item.NewId].AddAssistant(item); | ||
} | ||
|
||
public bool IsAvailable(DayOfWeek day) => this.UpgradeSlotItems.Values.Any(newSlot => newSlot.IsAvailable(day)); | ||
} | ||
|
||
|
||
public class UpgradeSlotItemInfo : ItemInfo | ||
{ | ||
public IdentifiableTable<AssistantInfo> Assistants { get; } = new IdentifiableTable<AssistantInfo>(); | ||
|
||
public int Level { get; set; } | ||
|
||
public int Fuel { get; internal set; } | ||
public int Ammo { get; internal set; } | ||
public int Steel { get; internal set; } | ||
public int Bauxite { get; internal set; } | ||
|
||
public ConsumptionInfo[] Consumptions { get; internal set; } | ||
|
||
internal UpgradeSlotItemInfo(Item item) : base(item.GetUpgradeSlotInfo()) | ||
{ | ||
this.AddAssistant(item); | ||
} | ||
|
||
internal void AddAssistant(Item item) | ||
{ | ||
this.Assistants.Add(new AssistantInfo(item)); | ||
} | ||
|
||
public bool IsAvailable(DayOfWeek day) => this.Assistants.Values.Any(ship => ship.IsAvailable(day)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Grabacr07.KanColleWrapper.Models; | ||
using Livet; | ||
using RemodelHelper.Models; | ||
|
||
namespace RemodelHelper.ViewModels | ||
{ | ||
public class ConsumptionViewModel : ViewModel | ||
{ | ||
public string Name | ||
{ | ||
get | ||
{ | ||
if (this.Info != null) | ||
{ | ||
switch (this.Info.Level) | ||
{ | ||
case 0: | ||
return "初期"; | ||
case 6: | ||
return "★6"; | ||
case 10: | ||
return "★max"; | ||
} | ||
} | ||
|
||
return string.Empty; | ||
} | ||
} | ||
|
||
private bool _isDifferent; | ||
|
||
public bool IsDifferent | ||
{ | ||
get { return this._isDifferent; } | ||
set | ||
{ | ||
if (this._isDifferent != value) | ||
{ | ||
this._isDifferent = value; | ||
this.RaisePropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
private ConsumptionInfo _info; | ||
|
||
public ConsumptionInfo Info | ||
{ | ||
get { return this._info; } | ||
set | ||
{ | ||
if (this._info != value) | ||
{ | ||
this._info = value; | ||
this.RaisePropertyChanged(); | ||
this.RaisePropertyChanged(nameof(this.Name)); | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.