package net.cobem.grizzly.communication.events.navigator;

import net.cobem.grizzly.Grizzly;
import net.cobem.grizzly.communication.EventRequest;
import net.cobem.grizzly.communication.GameEvent;
import net.cobem.grizzly.communication.composers.navigation.SendUserRoomsComposer;
import net.cobem.grizzly.habbohotel.rooms.Room;
import net.cobem.grizzly.habbohotel.sessions.Session;

import java.util.HashMap;
import java.util.Map;


public class ViewMyRoomsEvent implements GameEvent {
    @Override
    public void compose(Session Session, EventRequest Request) {
        Map<Integer, Room> UserRooms = new HashMap<>();//Grizzly.GrabHabboHotel().GrabRoomHandler().GrabUsersRooms(Session.GrabHabbo().ID);

        if (UserRooms.size() == 0) {
            UserRooms = Grizzly.getHabboHotel().getRooms().getByOwner(Session.getHabbo().getID(), true);
        }

        Session.sendResponse(SendUserRoomsComposer.compose(UserRooms));
    }
}
