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.
92 lines
1.9 KiB
C#
92 lines
1.9 KiB
C#
namespace Wizard;
|
|
|
|
public class AIVirtualCemetery
|
|
{
|
|
private class CemeteryInfo
|
|
{
|
|
public int OriginalCemetery { get; private set; }
|
|
|
|
public int CurrentCemetery { get; private set; }
|
|
|
|
public CemeteryInfo(int cemetery)
|
|
{
|
|
OriginalCemetery = cemetery;
|
|
CurrentCemetery = OriginalCemetery;
|
|
}
|
|
|
|
public void Reset()
|
|
{
|
|
CurrentCemetery = OriginalCemetery;
|
|
}
|
|
|
|
public void ResetNecromance(int count)
|
|
{
|
|
CurrentCemetery += count;
|
|
}
|
|
|
|
public void Necromance(int necromance, bool isPseudo)
|
|
{
|
|
if (necromance <= CurrentCemetery)
|
|
{
|
|
CurrentCemetery -= necromance;
|
|
if (!isPseudo)
|
|
{
|
|
OriginalCemetery = CurrentCemetery;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void Add(int cemetery)
|
|
{
|
|
CurrentCemetery += cemetery;
|
|
}
|
|
|
|
public void RollBackCemetery(int cemetery)
|
|
{
|
|
CurrentCemetery = cemetery;
|
|
}
|
|
}
|
|
|
|
private CemeteryInfo _allyCemetery;
|
|
|
|
private CemeteryInfo _enemyCemetery;
|
|
|
|
public AIVirtualCemetery(int allyCemetery, int enemyCemetery)
|
|
{
|
|
_allyCemetery = new CemeteryInfo(allyCemetery);
|
|
_enemyCemetery = new CemeteryInfo(enemyCemetery);
|
|
}
|
|
|
|
public void ResetAllCemetery()
|
|
{
|
|
_allyCemetery.Reset();
|
|
_enemyCemetery.Reset();
|
|
}
|
|
|
|
public void ResetNecromance(bool isAlly, int count)
|
|
{
|
|
(isAlly ? _allyCemetery : _enemyCemetery).ResetNecromance(count);
|
|
}
|
|
|
|
public int GetCemeteryCount(bool isAlly)
|
|
{
|
|
return (isAlly ? _allyCemetery : _enemyCemetery).CurrentCemetery;
|
|
}
|
|
|
|
public void ExecuteNecromance(int count, bool isAlly, bool isPseudo)
|
|
{
|
|
(isAlly ? _allyCemetery : _enemyCemetery).Necromance(count, isPseudo);
|
|
}
|
|
|
|
public void AddCemetery(int count, bool isAlly)
|
|
{
|
|
(isAlly ? _allyCemetery : _enemyCemetery).Add(count);
|
|
}
|
|
|
|
public void RollBackFromOneRecord(AIVirtualFieldRollBackRecord.CemeteryRecord record)
|
|
{
|
|
_allyCemetery.RollBackCemetery(record.AllyCemetery);
|
|
_enemyCemetery.RollBackCemetery(record.EnemyCemetery);
|
|
}
|
|
}
|