Added simulator ToString impls (similar to records)
This commit is contained in:
@@ -28,4 +28,7 @@ public struct ActionStates
|
|||||||
|
|
||||||
Observed = action == ActionType.Observe;
|
Observed = action == ActionType.Observe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override readonly string ToString() =>
|
||||||
|
$"ActionStates {{ TouchComboIdx = {TouchComboIdx}, CarefulObservationCount = {CarefulObservationCount}, UsedHeartAndSoul = {UsedHeartAndSoul}, Observed = {Observed} }}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,4 +113,7 @@ 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} }}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,7 @@ public sealed class SimulationInput
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Condition[] AvailableConditions => ConditionUtils.GetPossibleConditions(Recipe.ConditionsFlag);
|
public Condition[] AvailableConditions => ConditionUtils.GetPossibleConditions(Recipe.ConditionsFlag);
|
||||||
|
|
||||||
|
public override string ToString() =>
|
||||||
|
$"SimulationInput {{ Stats = {Stats}, Recipe = {Recipe}, Random = {Random}, StartingQuality = {StartingQuality}, BaseProgressGain = {BaseProgressGain}, BaseQualityGain = {BaseQualityGain} }}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,4 +42,7 @@ 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} }}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ public class Simulator
|
|||||||
State = state;
|
State = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetState(SimulationState state)
|
||||||
|
{
|
||||||
|
State = state;
|
||||||
|
}
|
||||||
|
|
||||||
public (ActionResponse Response, SimulationState NewState) Execute(SimulationState state, ActionType action)
|
public (ActionResponse Response, SimulationState NewState) Execute(SimulationState state, ActionType action)
|
||||||
{
|
{
|
||||||
State = state;
|
State = state;
|
||||||
|
|||||||
Reference in New Issue
Block a user