2019-11-14 05:18:44 +00:00
|
|
|
|
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>
|
|
|
|
|
{
|
2019-11-18 11:16:26 +00:00
|
|
|
|
{ AppletId.PlayerSelect, typeof(PlayerSelectApplet) },
|
2020-04-03 01:10:02 +01:00
|
|
|
|
{ AppletId.Controller, typeof(ControllerApplet) },
|
2019-11-18 11:16:26 +00:00
|
|
|
|
{ AppletId.SoftwareKeyboard, typeof(SoftwareKeyboardApplet) }
|
2019-11-14 05:18:44 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|