namespace ET { public class ServerInfosComponentDestroySystem : DestroySystem { 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) { self.recentlyServerInfo = self.ServerInfoList[recentId]; self.CurrentServerId = (int)recentId; } } }