Browse Source

Update ICommunicator

Zixuan 1 week ago
parent
commit
91470073e0

+ 4 - 0
FurnaceNewWorld/Communication/Communicator/Communicator.csproj

@@ -10,4 +10,8 @@
     <PackageReference Include="Microsoft.AspNet.SignalR.Client" />
   </ItemGroup>
 
+  <ItemGroup>
+    <ProjectReference Include="..\..\Universal\Universal.csproj" />
+  </ItemGroup>
+
 </Project>

+ 10 - 12
FurnaceNewWorld/Communication/Communicator/ICommunicator.cs

@@ -1,15 +1,13 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+namespace Communicator;
 
-namespace Communicator
+public interface ICommunicator : IDisposable
 {
-    public interface ICommunicator : IDisposable
-    {
-        bool Initialize();
-        void SubscribeDataItem(string dataKey, Action<object> callback);
-        void UnsubscribeDataItem(string dataKey, Action<object> callback);
-    }
+    bool Initialize(ICommunicatorProvider communicatorProvider);
+    void SubscribeDataItem(string dataKey, Action<object> callback);
+    void UnsubscribeDataItem(string dataKey, Action<object> callback);
+}
+
+public interface ICommunicatorProvider
+{
+    void DataChangedNotify(string dataKey, object rawData);
 }