Make combo actions much more clear

This commit is contained in:
Asriel Camora
2023-07-14 23:45:07 +04:00
parent 79377b5e89
commit 23dd60bb34
10 changed files with 116 additions and 166 deletions
+8 -6
View File
@@ -1,4 +1,5 @@
using Craftimizer.Simulator.Actions;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Craftimizer.Simulator;
@@ -11,22 +12,23 @@ public struct ActionStates
public bool UsedHeartAndSoul;
public bool Observed;
public void MutateState(ActionType action)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void MutateState(BaseAction baseAction)
{
if (action == ActionType.BasicTouch)
if (baseAction is BasicTouch)
TouchComboIdx = 1;
else if (TouchComboIdx == 1 && action == ActionType.StandardTouch)
else if (TouchComboIdx == 1 && baseAction is StandardTouch)
TouchComboIdx = 2;
else
TouchComboIdx = 0;
if (action == ActionType.CarefulObservation)
if (baseAction is CarefulObservation)
CarefulObservationCount++;
if (action == ActionType.HeartAndSoul)
if (baseAction is HeartAndSoul)
UsedHeartAndSoul = true;
Observed = action == ActionType.Observe;
Observed = baseAction is Observe;
}
public override readonly string ToString() =>