namespace Supercell.Laser.Logic.Home.Items { using System.Linq; using Newtonsoft.Json; using Supercell.Laser.Titan.DataStream; public class NotificationFactory { [JsonProperty("notification_list")] public List NotificationList; public NotificationFactory() { NotificationList = new List(); } public void Add(Notification notification) { notification.Index = GetIndex(); NotificationList.Add(notification); } public void ClearAllNotif() { NotificationList.Clear(); } public int GetIndex() { return NotificationList.Count; } public void Encode(ByteStream stream) { stream.WriteVInt(NotificationList.Count); foreach (Notification notification in NotificationList.AsEnumerable().Reverse()) { notification.Encode(stream); } } } }