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

import net.cobem.grizzly.communication.EventResponse;
import net.cobem.grizzly.communication.HeaderLibrary;
import net.cobem.grizzly.habbohotel.rooms.Room;

import java.util.Map;

public class SendUserRoomsComposer {
    public static EventResponse compose(Map<Integer, Room> PopulatedRooms) {
        EventResponse Message = new EventResponse();

        Message.Initialize(HeaderLibrary.ViewUserRoomsEvent);
        Message.addInt(5);
        Message.addString("");
        Message.addInt(PopulatedRooms.size());

        for (Room mRoom : PopulatedRooms.values()) {
            Message.addInt(mRoom.ID);
            Message.addString(mRoom.Title);
            Message.addBool(true);
            Message.addInt(mRoom.Owner);
            Message.addString(mRoom.OwnerByName);
            Message.addInt(mRoom.State); // mRoom state
            Message.addInt(mRoom.getParty().size());
            Message.addInt(50);// Max users
            Message.addString(mRoom.Description);
            Message.addInt(0);
            Message.addInt(0); // can trade?
            Message.addInt(0);
            Message.addInt(0);
            Message.addInt(0);
            Message.addInt(0);
            Message.addInt(0);
            Message.addString("");

            Message.addInt(1);
            Message.addString("nigga"); // Notsure

            Message.addInt(0);
            Message.addInt(0);
            Message.addInt(0);
            Message.addBool(true);
            Message.addBool(true);
            Message.addInt(0);
            Message.addInt(0);
        }

        Message.addInt(0);
        Message.addInt(0);
        Message.addBool(false);

        return Message;
    }
}
