using System.Linq;
using System.Collections.Generic;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.Items;
using Plus.Communication.Packets.Outgoing.Rooms.FloorPlan;
using Plus.Communication.Packets.Outgoing.Rooms.Engine;
using System.Drawing;
namespace Plus.Communication.Packets.Incoming.Rooms.FloorPlan
{
class FloorPlanEditorRoomPropertiesEvent : IPacketEvent
{
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().InRoom)
return;
Room Room = Session.GetHabbo().CurrentRoom;
if (Room == null)
return;
if (Room.GetGameMap().Model == null)
return;
List<Point> Squares = new List<Point>();
Room.GetRoomItemHandler().GetFloor.ToList().ForEach(Item =>
{
Item.GetCoords.ForEach(Point =>
{
if (!Squares.Contains(Point))
Squares.Add(Point);
});
});
Session.SendMessage(new FloorPlanFloorMapComposer(Squares));
Session.SendMessage(new FloorPlanSendDoorComposer(Room.GetGameMap().Model.DoorX, Room.GetGameMap().Model.DoorY, Room.GetGameMap().Model.DoorOrientation));
Session.SendMessage(new RoomVisualizationSettingsComposer(Room.WallThickness, Room.FloorThickness, PlusEnvironment.EnumToBool(Room.Hidewall.ToString())));
Squares.Clear();
Squares = null;
}
}
}