23 lines
803 B
C#
23 lines
803 B
C#
using Fantasy.DataStructure.Collection;
|
|
using Fantasy.Entitas;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using MongoDB.Bson.Serialization.Options;
|
|
|
|
namespace Fantasy;
|
|
|
|
/// <summary>
|
|
/// 这个代表一个用户身上所有邮件的组件
|
|
/// </summary>
|
|
public sealed class MailComponent : Entity
|
|
{
|
|
// 最大的邮件数量
|
|
public const int MaxMailCount = 50;
|
|
// 邮件的过期时间,这个是过期7天时间。
|
|
public const int MailExpireTime = 1000 * 60 * 60 * 24 * 7;
|
|
// 玩家的邮件
|
|
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
|
|
public Dictionary<long, Mail> Mails = new Dictionary<long, Mail>();
|
|
// 按照时间进行排序
|
|
[BsonIgnore]
|
|
public readonly SortedOneToManyList<long, long> Timer = new SortedOneToManyList<long, long>();
|
|
} |