mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
25
Assets/GameScripts/DotNet/Core/Fiber/Mailboxes.cs
Normal file
25
Assets/GameScripts/DotNet/Core/Fiber/Mailboxes.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public class Mailboxes
|
||||
{
|
||||
private readonly Dictionary<long, MailBoxComponent> mailboxes = new();
|
||||
|
||||
public void Add(MailBoxComponent mailBoxComponent)
|
||||
{
|
||||
this.mailboxes.Add(mailBoxComponent.Parent.InstanceId, mailBoxComponent);
|
||||
}
|
||||
|
||||
public void Remove(long instanceId)
|
||||
{
|
||||
this.mailboxes.Remove(instanceId);
|
||||
}
|
||||
|
||||
public MailBoxComponent Get(long instanceId)
|
||||
{
|
||||
this.mailboxes.TryGetValue(instanceId, out MailBoxComponent entity);
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user