aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Applets/AppletManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Applets/AppletManager.cs')
-rw-r--r--src/Ryujinx.HLE/HOS/Applets/AppletManager.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Ryujinx.HLE/HOS/Applets/AppletManager.cs b/src/Ryujinx.HLE/HOS/Applets/AppletManager.cs
new file mode 100644
index 00000000..a686a832
--- /dev/null
+++ b/src/Ryujinx.HLE/HOS/Applets/AppletManager.cs
@@ -0,0 +1,37 @@
+using Ryujinx.HLE.HOS.Applets.Browser;
+using Ryujinx.HLE.HOS.Applets.Error;
+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.Error, typeof(ErrorApplet) },
+ { AppletId.PlayerSelect, typeof(PlayerSelectApplet) },
+ { AppletId.Controller, typeof(ControllerApplet) },
+ { AppletId.SoftwareKeyboard, typeof(SoftwareKeyboardApplet) },
+ { AppletId.LibAppletWeb, typeof(BrowserApplet) },
+ { AppletId.LibAppletShop, typeof(BrowserApplet) },
+ { AppletId.LibAppletOff, typeof(BrowserApplet) }
+ };
+ }
+
+ 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.");
+ }
+ }
+}