fix(BuildCalc) Immortal filters

This commit is contained in:
2022-04-14 00:11:50 -04:00
parent a04a75a8fd
commit 231ce16dd6
11 changed files with 51 additions and 50 deletions
+2 -2
View File
@@ -16,6 +16,8 @@ public class BuildOrderService : IBuildOrderService
private readonly int HumanMicro = 2;
private int lastInterval;
private event Action OnChange = null!;
public Dictionary<int, List<EntityModel>> StartedOrders => buildOrder.StartedOrders;
public Dictionary<int, List<EntityModel>> CompletedOrders => buildOrder.CompletedOrders;
public Dictionary<string, int> UniqueCompletedTimes => buildOrder.UniqueCompletedTimes;
@@ -322,8 +324,6 @@ public class BuildOrderService : IBuildOrderService
return true;
}
private event Action OnChange = null!;
private void NotifyDataChanged()
{
OnChange?.Invoke();
@@ -1,10 +1,11 @@
using Model.Types;
using Model.Entity.Data;
using Model.Types;
namespace Services.Immortal;
public class ImmortalSelectionService : IImmortalSelectionService {
private string _selectedFaction = FactionType.QRath;
private string _selectedImmortal = ImmortalType.Orzum;
private string _selectedImmortal = DataType.IMMORTAL_Orzum;
public void Subscribe(Action action) {
OnChange += action;
@@ -26,9 +27,9 @@ public class ImmortalSelectionService : IImmortalSelectionService {
if (_selectedFaction == factionType) return false;
_selectedFaction = factionType;
if (_selectedFaction == FactionType.QRath) _selectedImmortal = ImmortalType.Orzum;
if (_selectedFaction == FactionType.QRath) _selectedImmortal = DataType.IMMORTAL_Orzum;
if (_selectedFaction == FactionType.Aru) _selectedImmortal = ImmortalType.Mala;
if (_selectedFaction == FactionType.Aru) _selectedImmortal = DataType.IMMORTAL_Mala;
NotifyDataChanged();
return true;
+6 -8
View File
@@ -7,13 +7,16 @@ public class KeyService : IKeyService {
private string? _hotkey;
private string _hotkeyGroup = "C";
private bool _isHoldingSpace;
private event Action? OnChange;
public void Subscribe(Action? action) {
_onChange += action;
OnChange += action;
}
public void Unsubscribe(Action? action) {
_onChange -= action;
OnChange -= action;
}
public bool AddPressedKey(string key) {
@@ -82,13 +85,8 @@ public class KeyService : IKeyService {
return _hotkeyGroup;
}
private event Action? _onChange;
private void NotifyDataChanged() {
_onChange?.Invoke();
OnChange?.Invoke();
}
public Action? OnChange() {
return _onChange;
}
}
+4 -2
View File
@@ -17,6 +17,10 @@ public class MemoryTesterService : IMemoryTesterService {
private readonly Random random = new();
private event MemoryAction OnChange = null!;
public void Subscribe(MemoryAction action) {
OnChange += action;
}
@@ -88,8 +92,6 @@ public class MemoryTesterService : IMemoryTesterService {
//public delegate void MemoryAction(MemoryTesterActions memoryAction);
private event MemoryAction OnChange = null!;
private void NotifyDataChanged(MemoryTesterEvent memoryAction) {
OnChange?.Invoke(memoryAction);
}
+5 -8
View File
@@ -3,12 +3,14 @@
public class TimingService : ITimingService {
private int _timing = 1500;
private event Action? OnChange;
public void Subscribe(Action? action) {
_onChange += action;
OnChange += action;
}
public void Unsubscribe(Action? action) {
_onChange -= action;
OnChange -= action;
}
public int GetTiming() {
@@ -22,13 +24,8 @@ public class TimingService : ITimingService {
}
}
private event Action? _onChange;
private void NotifyDataChanged() {
_onChange?.Invoke();
OnChange?.Invoke();
}
public Action? OnChange() {
return _onChange;
}
}