28 lines
1.2 KiB
C#
28 lines
1.2 KiB
C#
using Fantasy.DataStructure.Collection;
|
|
using Fantasy.Entitas;
|
|
|
|
namespace Fantasy;
|
|
|
|
/// <summary>
|
|
/// 邮件物流中转中心,用来存放所有离线的邮件。
|
|
/// 玩家可以在上线的第一时间去这里领取属于自己的邮件。
|
|
/// </summary>
|
|
public class MailBoxManageComponent : Entity
|
|
{
|
|
// 定时清楚过期邮件的时间
|
|
public const int MailCheckTIme = 10000;
|
|
// 存放所有邮箱都会在这里,包括发送给个人的和所有人的邮件。
|
|
public readonly Dictionary<long, MailBox> MailBoxes = new Dictionary<long, MailBox>();
|
|
// 个人领取邮件列表
|
|
public readonly OneToManyList<long, MailBox> MailsByAccount = new OneToManyList<long, MailBox>();
|
|
// 按照邮件箱类型存储
|
|
public readonly OneToManyList<int, MailBox> MailsByMailBoxType = new OneToManyList<int, MailBox>();
|
|
// 按照时间排序的邮件箱
|
|
public readonly SortedOneToManyList<long, long> Timers = new SortedOneToManyList<long, long>();
|
|
// 临时的存放过期时间的队列
|
|
public readonly Queue<long> TimeOutQueue = new Queue<long>();
|
|
// 时间任务的Id
|
|
public long TimerId;
|
|
// 最小的时间
|
|
public long MinTime;
|
|
} |