using Fantasy.Entitas.Interface;

namespace NB.Chat;

public class MailBoxDestroySystem : DestroySystem<MailBox>
{
    protected override void Destroy(MailBox self)
    {
        if (self.Mail != null)
        {
            self.Mail.Dispose();
            self.Mail = null;
        }

        self.BoxType = MailBoxType.None;
        self.CreateTime = 0;
        self.ExpireTime = 0;
        self.SendAccountId = 0;
        self.AccountId.Clear();
        self.Received.Clear();
    }
}