From 39899c04076a8e9004b173320ffbb6dbf45ff3e4 Mon Sep 17 00:00:00 2001
From: Ac_K <Acoustik666@gmail.com>
Date: Fri, 19 Mar 2021 00:31:08 +0100
Subject: [PATCH] IPC: Remove IIpcService interface (#2121)

This PR remove the IIpcService.cs interface usage which isn't needed anymore since the interface is only used by IpcService class. We can use it directly.
---
 .../Exceptions/ServiceNotImplementedException.cs     | 10 +++++-----
 Ryujinx.HLE/HOS/Services/IIpcService.cs              | 10 ----------
 Ryujinx.HLE/HOS/Services/IpcService.cs               | 12 ++++++------
 3 files changed, 11 insertions(+), 21 deletions(-)
 delete mode 100644 Ryujinx.HLE/HOS/Services/IIpcService.cs

diff --git a/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs b/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs
index 58c15fdd..69493918 100644
--- a/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs
+++ b/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs
@@ -14,15 +14,15 @@ namespace Ryujinx.HLE.Exceptions
     [Serializable]
     internal class ServiceNotImplementedException : Exception
     {
-        public IIpcService Service { get; }
+        public IpcService Service { get; }
         public ServiceCtx Context { get; }
         public IpcMessage Request { get; }
 
-        public ServiceNotImplementedException(IIpcService service, ServiceCtx context)
+        public ServiceNotImplementedException(IpcService service, ServiceCtx context)
             : this(service, context, "The service call is not implemented.")
         { }
 
-        public ServiceNotImplementedException(IIpcService service, ServiceCtx context, string message)
+        public ServiceNotImplementedException(IpcService service, ServiceCtx context, string message)
             : base(message)
         {
             Service = service;
@@ -30,7 +30,7 @@ namespace Ryujinx.HLE.Exceptions
             Request = context.Request;
         }
 
-        public ServiceNotImplementedException(IIpcService service, ServiceCtx context, string message, Exception inner)
+        public ServiceNotImplementedException(IpcService service, ServiceCtx context, string message, Exception inner)
             : base(message, inner)
         {
             Service = service;
@@ -158,7 +158,7 @@ namespace Ryujinx.HLE.Exceptions
                 var method   = frame.GetMethod();
                 var declType = method.DeclaringType;
 
-                if (typeof(IIpcService).IsAssignableFrom(declType))
+                if (typeof(IpcService).IsAssignableFrom(declType))
                 {
                     return (declType, method);
                 }
diff --git a/Ryujinx.HLE/HOS/Services/IIpcService.cs b/Ryujinx.HLE/HOS/Services/IIpcService.cs
deleted file mode 100644
index f1712491..00000000
--- a/Ryujinx.HLE/HOS/Services/IIpcService.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace Ryujinx.HLE.HOS.Services
-{
-    interface IIpcService
-    {
-        IReadOnlyDictionary<int, MethodInfo> Commands { get; }
-    }
-}
\ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/IpcService.cs b/Ryujinx.HLE/HOS/Services/IpcService.cs
index f9858107..095e332c 100644
--- a/Ryujinx.HLE/HOS/Services/IpcService.cs
+++ b/Ryujinx.HLE/HOS/Services/IpcService.cs
@@ -9,7 +9,7 @@ using System.Linq;
 
 namespace Ryujinx.HLE.HOS.Services
 {
-    abstract class IpcService : IIpcService
+    abstract class IpcService
     {
         public IReadOnlyDictionary<int, MethodInfo> Commands { get; }
 
@@ -55,7 +55,7 @@ namespace Ryujinx.HLE.HOS.Services
 
         public void CallMethod(ServiceCtx context)
         {
-            IIpcService service = this;
+            IpcService service = this;
 
             if (_isDomain)
             {
@@ -173,7 +173,7 @@ namespace Ryujinx.HLE.HOS.Services
         {
             int objId = context.Request.ObjectIds[index];
 
-            IIpcService obj = _parent.GetObject(objId);
+            IpcService obj = _parent.GetObject(objId);
 
             return obj is T t ? t : null;
         }
@@ -190,7 +190,7 @@ namespace Ryujinx.HLE.HOS.Services
             return false;
         }
 
-        private int Add(IIpcService obj)
+        private int Add(IpcService obj)
         {
             return _domainObjects.Add(obj);
         }
@@ -207,9 +207,9 @@ namespace Ryujinx.HLE.HOS.Services
             return obj != null;
         }
 
-        private IIpcService GetObject(int id)
+        private IpcService GetObject(int id)
         {
-            return _domainObjects.GetData<IIpcService>(id);
+            return _domainObjects.GetData<IpcService>(id);
         }
 
         public void SetParent(IpcService parent)