using System; using System.Collections.Generic; using System.Linq; using System.Text; using DuckEmulator.Security; using DuckEmulator.HabboHotel.Outside.Messages.Types; namespace DuckEmulator.HabboHotel.Outside.Rooms { class RoomIcon { internal uint RoomId; internal int ForeGround; internal int BackGround; internal SecurityList Items; internal RoomIcon(uint RoomId, int ForeGround, int BackGround, string Items) { this.RoomId = RoomId; this.ForeGround = ForeGround; this.BackGround = BackGround; this.Items = new SecurityList(); if (Items.Length > 0) { var SplitItems = Items.Split('|'); foreach (string IconData in SplitItems.ToList()) { if (IconData.Length > 0) { var DataParams = IconData.Split(','); if (DataParams.Length == 2) { this.Items.Add(new IconItem(int.Parse(DataParams[1]), int.Parse(DataParams[0]))); } } } } } internal void Serialize(ServerMessage Message) { Message.AppendInt32(BackGround); Message.AppendInt32(ForeGround); Message.AppendInt32(Items.Count); if (Items.Count > 0) { foreach (IconItem Item in Items) { Message.AppendInt32(Item.PlaceId); Message.AppendInt32(Item.PicId); } } Message.AppendBoolean(false); } } class IconItem { internal int PicId; internal int PlaceId; internal IconItem(int PicId, int PlaceId) { this.PicId = PicId; this.PlaceId = PlaceId; } } }