提交示例代码
This commit is contained in:
23
邮件系统课程完整代码/Server/Entity/Mail/Components/MailComponent.cs
Normal file
23
邮件系统课程完整代码/Server/Entity/Mail/Components/MailComponent.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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>();
|
||||
}
|
||||
Reference in New Issue
Block a user