Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
59 lines
1.1 KiB
C#
59 lines
1.1 KiB
C#
using System;
|
|
using Cute;
|
|
using Wizard;
|
|
|
|
public class AITurnControl
|
|
{
|
|
private DateTime _startTime;
|
|
|
|
private bool _isStartTimer;
|
|
|
|
public AITurnControl()
|
|
{
|
|
_isStartTimer = false;
|
|
}
|
|
|
|
public void StartTurnTimer()
|
|
{
|
|
_isStartTimer = true;
|
|
_startTime = TimeUtil.GetAbsoluteTime();
|
|
}
|
|
|
|
public void SetAndStartTurnTimer(DateTime time)
|
|
{
|
|
_isStartTimer = true;
|
|
_startTime = time;
|
|
}
|
|
|
|
public void Update(IEnemyAI ai)
|
|
{
|
|
if (ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus.IsAlive && !ai.IsConnectNetwork)
|
|
{
|
|
ai.Reconnect();
|
|
}
|
|
if (!_isStartTimer || !ToolboxGame.RealTimeNetworkAgent.PlayerNetworkStatus.IsAlive)
|
|
{
|
|
if (_isStartTimer && ai.IsConnectNetwork)
|
|
{
|
|
ai.Disconnect();
|
|
}
|
|
}
|
|
else if ((float)NetworkUtility.GetTimeSpanSecond(_startTime.Ticks) >= 90f)
|
|
{
|
|
if (ai.IsStackAction)
|
|
{
|
|
ai.CleanupStackedAction();
|
|
}
|
|
if (!ai.IsStackAction)
|
|
{
|
|
ai.TurnEnd();
|
|
}
|
|
}
|
|
}
|
|
|
|
public void StopTurnTimer()
|
|
{
|
|
_isStartTimer = false;
|
|
}
|
|
}
|