Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
41 lines
921 B
C#
41 lines
921 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Wizard;
|
|
|
|
public class AIVirtualFieldRollBackStackProcessor : AIVirtualFieldRollBackBasicProcessor
|
|
{
|
|
private Stack<AIVirtualFieldRollBackRecord> _recordStack;
|
|
|
|
public bool HasRecord => _recordStack.Count > 0;
|
|
|
|
public AIVirtualFieldRollBackStackProcessor(AIVirtualField targetField)
|
|
: base(targetField)
|
|
{
|
|
_recordStack = new Stack<AIVirtualFieldRollBackRecord>();
|
|
}
|
|
|
|
public void RegisterRecord()
|
|
{
|
|
_recordStack.Push(new AIVirtualFieldRollBackRecord(_field));
|
|
}
|
|
|
|
public override void ResetVirtualFieldToStart()
|
|
{
|
|
base.ResetVirtualFieldToStart();
|
|
_recordStack.Clear();
|
|
}
|
|
|
|
public void RollBackFieldWithIteration(int iteration = 1)
|
|
{
|
|
for (int i = 0; i < iteration; i++)
|
|
{
|
|
if (!HasRecord)
|
|
{
|
|
break;
|
|
}
|
|
AIVirtualFieldRollBackRecord record = _recordStack.Pop();
|
|
RollBackFromOneRecord(record);
|
|
}
|
|
}
|
|
}
|