1234567891011121314151617181920212223242526272829 |
- namespace ET
- {
- public class ServerInfosComponentDestroySystem : DestroySystem<ServerInfosComponent>
- {
- public override void Destroy(ServerInfosComponent self)
- {
- foreach (var serverInfo in self.ServerInfoList.Values)
- {
- serverInfo?.Dispose();
- }
- self.ServerInfoList.Clear();
- }
- }
- public static class ServerInfosComponentSystem
- {
- public static void Add(this ServerInfosComponent self, ServerInfo serverInfo)
- {
- self.ServerInfoList.Add(serverInfo.Id, serverInfo);
- }
- public static void SetRecentlyServerInfo(this ServerInfosComponent self, long recentId)
- {
- recentId = 2;
- self.recentlyServerInfo = self.ServerInfoList[recentId];
- self.CurrentServerId = (int)recentId;
- }
- }
- }
|