using System; using System.Collections.Generic; using Newtonsoft.Json; namespace GrasscutterTools.Game.Mail { /// /// 邮件 /// public class Mail { /// /// 发件人 /// public string Sender { get; set; } /// /// 收件人 (0 表示发送给所有人) /// public int Recipient { get; set; } /// /// 是否发送给所有人 /// [JsonIgnore] public bool SendToAll => Recipient == 0; /// /// 邮件标题 /// public string Title { get; set; } /// /// 邮件内容 /// public string Content { get; set; } /// /// 附件列表 /// public List ItemList { get; set; } /// /// 发送时间 /// public DateTime SendTime { get; set; } public override string ToString() { if (SendToAll) return $"ToAll: [{Title}] {Content} | {SendTime}"; else return $"To[{Recipient}]: [{Title}] {Content} | {SendTime}"; } } }