2020-05-14 18:56:14 -07:00
|
|
|
|
using Ryujinx.HLE.HOS.Applets.Browser;
|
2020-09-27 15:00:38 -07:00
|
|
|
|
using Ryujinx.HLE.HOS.Applets.Error;
|
2020-05-14 18:56:14 -07:00
|
|
|
|
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
2019-11-13 21:18:44 -08:00
|
|
|
|
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>
|
|
|
|
|
{
|
2020-09-27 15:00:38 -07:00
|
|
|
|
{ AppletId.Error, typeof(ErrorApplet) },
|
2019-11-18 03:16:26 -08:00
|
|
|
|
{ AppletId.PlayerSelect, typeof(PlayerSelectApplet) },
|
2020-04-02 17:10:02 -07:00
|
|
|
|
{ AppletId.Controller, typeof(ControllerApplet) },
|
2020-05-14 18:56:14 -07:00
|
|
|
|
{ AppletId.SoftwareKeyboard, typeof(SoftwareKeyboardApplet) },
|
|
|
|
|
{ AppletId.LibAppletWeb, typeof(BrowserApplet) },
|
|
|
|
|
{ AppletId.LibAppletShop, typeof(BrowserApplet) },
|
|
|
|
|
{ AppletId.LibAppletOff, typeof(BrowserApplet) }
|
2019-11-13 21:18:44 -08: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.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|