频道聊天相关

This commit is contained in:
2025-08-12 14:05:23 +08:00
parent 12c328d538
commit 15723850c0
17 changed files with 212 additions and 66 deletions

View File

@@ -1,10 +1,38 @@
using Fantasy.Entitas;
using Fantasy.Entitas.Interface;
using Fantasy.Helper;
namespace NB.Chat;
public class ChatChannelCenterComponentAwakeSystem : AwakeSystem<ChatChannelCenterComponent>
{
protected override void Awake(ChatChannelCenterComponent self)
{
}
}
public class ChatChannelCenterComponentDestroySystem : DestroySystem<ChatChannelCenterComponent>
{
protected override void Destroy(ChatChannelCenterComponent self)
{
self.Channels.Clear();
}
}
public static class ChatChannelCenterComponentSystem
{
/// <summary>
/// 获取
/// </summary>
/// <param name="self"></param>
/// <param name="channelId"></param>
/// <param name="channel"></param>
/// <returns></returns>
public static bool TryGet(this ChatChannelCenterComponent self, long channelId, out ChatChannel? channel)
{
return self.Channels.TryGetValue(channelId, out channel);
}
/// <summary>
/// 申请创建一个频道
/// </summary>
@@ -26,18 +54,6 @@ public static class ChatChannelCenterComponentSystem
return channel;
}
/// <summary>
/// 获取
/// </summary>
/// <param name="self"></param>
/// <param name="channelId"></param>
/// <param name="channel"></param>
/// <returns></returns>
public static bool TryGet(this ChatChannelCenterComponent self, long channelId, out ChatChannel? channel)
{
return self.Channels.TryGetValue(channelId, out channel);
}
/// <summary>
/// 解散
/// </summary>