Files
gamer147 957af3d1ec 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.
2026-06-05 17:22:20 -04:00

78 lines
2.1 KiB
C#

using System;
using System.Collections;
using UnityEngine;
namespace Cute;
public class TimeData
{
private long serverTime;
private long connectClientTime;
public void Set(long setServerTime)
{
serverTime = setServerTime;
connectClientTime = (long)TimeNativePlugin.GetDeviceOperatingTime();
}
public DateTime GetNowTime()
{
return TimeUtil.GetNowTime(serverTime, connectClientTime);
}
public DateTime GetNowTime_UTC()
{
return TimeUtil.GetNowTime_UTC(serverTime, connectClientTime);
}
public float GetTimeLeftLong(long endTime)
{
return (float)TimeUtil.GetTimeLeft(serverTime, endTime, 0L).millisecond / 1000f;
}
[Obsolete("動作未検証", false)]
public IEnumerator StartTimeLeft(MonoBehaviour obj, long endTime, Action<TimeUtil.TimeLeftParam> callback)
{
IEnumerator enumerator = timeLeftCoroutine(callback, endTime, 0L);
obj.StartCoroutine(enumerator);
return enumerator;
}
[Obsolete("動作未検証", false)]
public IEnumerator StartTimeLeft(MonoBehaviour obj, long endTime, long consumingTime, Action<TimeUtil.TimeLeftParam> callback)
{
IEnumerator enumerator = timeLeftCoroutine(callback, endTime, consumingTime);
obj.StartCoroutine(enumerator);
return enumerator;
}
[Obsolete("動作未検証", false)]
public string GetNowTimeString()
{
DateTime nowTime = GetNowTime();
return $"{nowTime.Year:D4}-{nowTime.Month:D2}-{nowTime.Day:D2} {nowTime.Hour:D2}:{nowTime.Minute:D2}:{nowTime.Second:D2}";
}
[Obsolete("動作未検証", false)]
private TimeUtil.TimeLeftParam GetTimeLeft(long endTime, long consumingTime = 0L)
{
return TimeUtil.GetTimeLeft(TimeUtil.ToUnixTime(GetNowTime()), endTime, consumingTime);
}
[Obsolete("動作未検証", false)]
private IEnumerator timeLeftCoroutine(Action<TimeUtil.TimeLeftParam> callback, long endTime, long consumingTime = 0L)
{
while (true)
{
TimeUtil.TimeLeftParam timeLeft = GetTimeLeft(endTime, consumingTime);
callback(timeLeft);
if (timeLeft.isEnd)
{
break;
}
yield return null;
}
}
}