Switch back to record structs
This commit is contained in:
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
|
|||||||
namespace Craftimizer.Simulator;
|
namespace Craftimizer.Simulator;
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Auto)]
|
[StructLayout(LayoutKind.Auto)]
|
||||||
public struct ActionStates
|
public record struct ActionStates
|
||||||
{
|
{
|
||||||
public byte TouchComboIdx;
|
public byte TouchComboIdx;
|
||||||
public byte CarefulObservationCount;
|
public byte CarefulObservationCount;
|
||||||
@@ -30,7 +30,4 @@ public struct ActionStates
|
|||||||
|
|
||||||
Observed = baseAction is Observe;
|
Observed = baseAction is Observe;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override readonly string ToString() =>
|
|
||||||
$"ActionStates {{ TouchComboIdx = {TouchComboIdx}, CarefulObservationCount = {CarefulObservationCount}, UsedHeartAndSoul = {UsedHeartAndSoul}, Observed = {Observed} }}";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
|
|||||||
namespace Craftimizer.Simulator;
|
namespace Craftimizer.Simulator;
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Auto)]
|
[StructLayout(LayoutKind.Auto)]
|
||||||
public struct Effects
|
public record struct Effects
|
||||||
{
|
{
|
||||||
public byte InnerQuiet;
|
public byte InnerQuiet;
|
||||||
public byte WasteNot;
|
public byte WasteNot;
|
||||||
@@ -113,7 +113,4 @@ public struct Effects
|
|||||||
if (Manipulation > 0)
|
if (Manipulation > 0)
|
||||||
Manipulation--;
|
Manipulation--;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override readonly string ToString() =>
|
|
||||||
$"Effects {{ InnerQuiet = {InnerQuiet}, WasteNot = {WasteNot}, Veneration = {Veneration}, GreatStrides = {GreatStrides}, Innovation = {Innovation}, FinalAppraisal = {FinalAppraisal}, WasteNot2 = {WasteNot2}, MuscleMemory = {MuscleMemory}, Manipulation = {Manipulation}, HeartAndSoul = {HeartAndSoul} }}";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
|
|||||||
namespace Craftimizer.Simulator;
|
namespace Craftimizer.Simulator;
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Auto)]
|
[StructLayout(LayoutKind.Auto)]
|
||||||
public struct SimulationState
|
public record struct SimulationState
|
||||||
{
|
{
|
||||||
public readonly SimulationInput Input;
|
public readonly SimulationInput Input;
|
||||||
|
|
||||||
@@ -42,7 +42,4 @@ public struct SimulationState
|
|||||||
ActionCount = 0;
|
ActionCount = 0;
|
||||||
ActionStates = new();
|
ActionStates = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override readonly string ToString() =>
|
|
||||||
$"SimulationState {{ Input = {Input}, ActionCount = {ActionCount}, StepCount = {StepCount}, Progress = {Progress}, Quality = {Quality}, Durability = {Durability}, CP = {CP}, Condition = {Condition}, ActiveEffects = {ActiveEffects}, ActionStates = {ActionStates} }}";
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user