1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-10 23:36:39 +00:00
Ryujinx/Ryujinx.HLE/HOS/Applets/AppletManager.cs

31 lines
901 B
C#
Raw Normal View History

using Ryujinx.HLE.HOS.Services.Am.AppletAE;
using System;
using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Applets
{
static class AppletManager
{
private static Dictionary<AppletId, Type> _appletMapping;
static AppletManager()
{
_appletMapping = new Dictionary<AppletId, Type>
{
{ AppletId.PlayerSelect, typeof(PlayerSelectApplet) },
{ AppletId.SoftwareKeyboard, typeof(SoftwareKeyboardApplet) }
};
}
public static IApplet Create(AppletId applet, Horizon system)
{
if (_appletMapping.TryGetValue(applet, out Type appletClass))
{
return (IApplet)Activator.CreateInstance(appletClass, system);
}
throw new NotImplementedException($"{applet} applet is not implemented.");
}
}
}