namespace Supercell.Laser.Logic.Home.Items { using System.Collections.Generic; using System.Text.Json.Serialization; using Supercell.Laser.Logic.Helper; using Supercell.Laser.Titan.DataStream; public class NotificationFactory { [JsonInclude] [JsonPropertyName("notification_list")] public List NotificationList; public NotificationFactory() { NotificationList = new List(); } public void Add(Notification notification) { notification.Index = GetIndex(); NotificationList.Add(notification); } public void Remove(int Id) { NotificationList.RemoveAll(n => n.Id == Id); } public int GetIndex() { return NotificationList.Count; } public void Encode(ByteStream stream) { stream.WriteVInt(NotificationList.Count); foreach (Notification notification in NotificationList) { notification.Encode(stream); } NotificationList.Clear(); } } }