AxibugEmuOnline/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_LoadState.cs
2024-09-13 17:39:48 +08:00

33 lines
973 B
C#

using AxibugEmuOnline.Client.ClientCore;
using System.Diagnostics;
using VirtualNes.Core;
namespace AxibugEmuOnline.Client
{
public class InGameUI_LoadState : ExecuteMenu
{
private InGameUI m_gameUI;
public InGameUI_LoadState(InGameUI gameUI) : base("śÁČĄżěŐŐ", null)
{
m_gameUI = gameUI;
}
public override void OnExcute()
{
Stopwatch sw = Stopwatch.StartNew();
switch (m_gameUI.RomFile.Platform)
{
case EnumPlatform.NES:
if (m_gameUI.GetQuickState<State>(out var quickState))
{
m_gameUI.GetCore<NesEmulator>().NesCore.LoadState(quickState);
}
break;
}
sw.Stop();
App.log.Info($"{m_gameUI.RomFile.Platform}====>żěŐŐźÓÔŘşÄĘą:{sw.Elapsed.TotalMilliseconds}ms");
}
}
}