package net.cobem.grizzly.communication.composers.rooms;

import gnu.trove.map.hash.THashMap;
import net.cobem.grizzly.communication.EventResponse;
import net.cobem.grizzly.communication.HeaderLibrary;
import net.cobem.grizzly.habbohotel.rooms.items.FloorItem;

public class SendFloorItemsComposer {
    public static EventResponse compose(int OwnerID, String OwnerName, THashMap<Integer, FloorItem> Items) {
        EventResponse Message = new EventResponse();

        Message.Initialize(HeaderLibrary.InitializeFloorItemsEvent);
        Message.addInt(1);
        Message.addInt(OwnerID);
        Message.addString(OwnerName); // Owner Name
        Message.addInt(Items.size()); //Floor Item Count

        for (FloorItem Item : Items.values()) {
            Message.addBody(Item);
            Message.addInt(OwnerID);
        }

        return Message;
    }
}
