AppletManager.cs 814 B

1234567891011121314151617181920212223242526272829
  1. using Ryujinx.HLE.HOS.Services.Am.AppletAE;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.HLE.HOS.Applets
  5. {
  6. static class AppletManager
  7. {
  8. private static Dictionary<AppletId, Type> _appletMapping;
  9. static AppletManager()
  10. {
  11. _appletMapping = new Dictionary<AppletId, Type>
  12. {
  13. { AppletId.PlayerSelect, typeof(PlayerSelectApplet) }
  14. };
  15. }
  16. public static IApplet Create(AppletId applet, Horizon system)
  17. {
  18. if (_appletMapping.TryGetValue(applet, out Type appletClass))
  19. {
  20. return (IApplet)Activator.CreateInstance(appletClass, system);
  21. }
  22. throw new NotImplementedException($"{applet} applet is not implemented.");
  23. }
  24. }
  25. }