/** * Grasscutter Tools * Copyright (C) 2022 jie65535 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * **/ 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}"; } } }