Refactor alot of stuff
This commit is contained in:
@@ -9,6 +9,42 @@ namespace KernelPanic.Combat
|
||||
/// </summary>
|
||||
public sealed class CardInstance
|
||||
{
|
||||
// Explicit checkpoint values: no gameplay hooks or random draws during restoration.
|
||||
internal CardInstanceValues CaptureValues() => new()
|
||||
{
|
||||
_isBroken = _isBroken,
|
||||
_corruptionLastRecoveryRound = _corruptionLastRecoveryRound,
|
||||
InstanceId = InstanceId,
|
||||
TemporaryCostDelta = TemporaryCostDelta,
|
||||
PermanentCostDelta = PermanentCostDelta,
|
||||
MagnitudeBonus = MagnitudeBonus,
|
||||
DrawRider = DrawRider,
|
||||
ExhaustOnPlay = ExhaustOnPlay,
|
||||
UpgradeLevel = UpgradeLevel,
|
||||
QueuePlayCount = QueuePlayCount,
|
||||
WasFirstCardThisTurn = WasFirstCardThisTurn,
|
||||
HadFedoraNonCrashBonus = HadFedoraNonCrashBonus,
|
||||
CorruptionRoundsRemaining = CorruptionRoundsRemaining,
|
||||
IsLocked = IsLocked,
|
||||
};
|
||||
internal void RestoreValues(CardInstanceValues value)
|
||||
{
|
||||
_isBroken = value._isBroken;
|
||||
_corruptionLastRecoveryRound = value._corruptionLastRecoveryRound;
|
||||
InstanceId = value.InstanceId;
|
||||
TemporaryCostDelta = value.TemporaryCostDelta;
|
||||
PermanentCostDelta = value.PermanentCostDelta;
|
||||
MagnitudeBonus = value.MagnitudeBonus;
|
||||
DrawRider = value.DrawRider;
|
||||
ExhaustOnPlay = value.ExhaustOnPlay;
|
||||
UpgradeLevel = value.UpgradeLevel;
|
||||
QueuePlayCount = value.QueuePlayCount;
|
||||
WasFirstCardThisTurn = value.WasFirstCardThisTurn;
|
||||
HadFedoraNonCrashBonus = value.HadFedoraNonCrashBonus;
|
||||
CorruptionRoundsRemaining = value.CorruptionRoundsRemaining;
|
||||
IsLocked = value.IsLocked;
|
||||
}
|
||||
|
||||
private readonly List<CombatantState> _targetSnapshot = new();
|
||||
private bool _isBroken;
|
||||
private int _corruptionLastRecoveryRound;
|
||||
@@ -189,6 +225,9 @@ namespace KernelPanic.Combat
|
||||
_targetSnapshot.Clear();
|
||||
}
|
||||
|
||||
internal void RestoreSnapshotTargets(IEnumerable<CombatantState> targets)
|
||||
{ _targetSnapshot.Clear(); _targetSnapshot.AddRange(targets); }
|
||||
|
||||
public void ResetCombatState()
|
||||
{
|
||||
TemporaryCostDelta = 0;
|
||||
|
||||
Reference in New Issue
Block a user