feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
This commit is contained in:
116
SVSim.BattleEngine/Engine/StockEmitMgr.cs
Normal file
116
SVSim.BattleEngine/Engine/StockEmitMgr.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public class StockEmitMgr : StockSequenceMgr
|
||||
{
|
||||
private List<Dictionary<string, object>> _pubSequenceSendAllData = new List<Dictionary<string, object>>();
|
||||
|
||||
public static float WAIT_ACK_TIMEOUT = 3f;
|
||||
|
||||
private long _emitTime;
|
||||
|
||||
public static float ACK_NOT_RECEIVE_LOG_TIME = 15f;
|
||||
|
||||
public int SequenceNumber { get; private set; }
|
||||
|
||||
public long EmitToAckCheckTime { get; private set; }
|
||||
|
||||
public bool IsReceiveAck { get; private set; }
|
||||
|
||||
public StockEmitMgr(string name)
|
||||
: base(name)
|
||||
{
|
||||
SequenceNumber = 1;
|
||||
}
|
||||
|
||||
public override void StockData(Dictionary<string, object> data)
|
||||
{
|
||||
base.StockData(data);
|
||||
bool flag = false;
|
||||
if (_pubSequenceSendAllData.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < _pubSequenceSendAllData.Count; i++)
|
||||
{
|
||||
if (_pubSequenceSendAllData[i].ContainsKey("pubSeq") && data.ContainsKey("pubSeq") && _pubSequenceSendAllData[i]["pubSeq"] == data["pubSeq"])
|
||||
{
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
_pubSequenceSendAllData.Add(data);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddSequenceNumber()
|
||||
{
|
||||
SequenceNumber++;
|
||||
}
|
||||
|
||||
public void ResetSequence()
|
||||
{
|
||||
SequenceNumber = 1;
|
||||
_pubSequenceSendAllData.Clear();
|
||||
}
|
||||
|
||||
public Dictionary<string, object> GetSelectData(int num)
|
||||
{
|
||||
Dictionary<string, object> dictionary = sequenceDataList.FirstOrDefault((Dictionary<string, object> d) => GetSequenceNumber(d) == num);
|
||||
if (dictionary == null)
|
||||
{
|
||||
dictionary = _pubSequenceSendAllData.FirstOrDefault((Dictionary<string, object> d) => GetSequenceNumber(d) == num);
|
||||
}
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
public Dictionary<string, object> GetAllSelectData(int num)
|
||||
{
|
||||
return _pubSequenceSendAllData.FirstOrDefault((Dictionary<string, object> d) => GetSequenceNumber(d) == num);
|
||||
}
|
||||
|
||||
public void FirstAddSequenceDataList(Dictionary<string, object> info)
|
||||
{
|
||||
lock (sequenceDataList)
|
||||
{
|
||||
sequenceDataList.Insert(0, info);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Dictionary<string, object>> GetSequenceAllData()
|
||||
{
|
||||
return sequenceDataList;
|
||||
}
|
||||
|
||||
public void Recovery(int sequenceNumber)
|
||||
{
|
||||
SequenceNumber = sequenceNumber;
|
||||
ClearSequenceDataList();
|
||||
}
|
||||
|
||||
public void SetEmitTime(long emitTime)
|
||||
{
|
||||
_emitTime = emitTime;
|
||||
if (IsReceiveAck)
|
||||
{
|
||||
SetEmitToAckCheckTime(emitTime);
|
||||
}
|
||||
IsReceiveAck = false;
|
||||
}
|
||||
|
||||
public void SetEmitToAckCheckTime(long time)
|
||||
{
|
||||
EmitToAckCheckTime = time;
|
||||
}
|
||||
|
||||
public void SetReceiveAck()
|
||||
{
|
||||
IsReceiveAck = true;
|
||||
}
|
||||
|
||||
public long GetEmitTime()
|
||||
{
|
||||
return _emitTime;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user