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

import net.cobem.grizzly.Grizzly;
import net.cobem.grizzly.communication.EventRequest;
import net.cobem.grizzly.communication.GameEvent;
import net.cobem.grizzly.habbohotel.rooms.Room;
import net.cobem.grizzly.habbohotel.rooms.items.WallItem;
import net.cobem.grizzly.habbohotel.sessions.Session;

public class ChangeWallStateEvent implements GameEvent {

    @Override
    public void compose(Session Session, EventRequest Request) {
        if (!Session.getActor().CurrentRoom.getRightHolders().contains(Session.getHabbo().getID())) {
            return;
        }

        int ID = Request.readInt();

        Room mRoom = Session.getActor().CurrentRoom;

        WallItem Item = mRoom.getWalls().get(ID);

        Grizzly.getHabboHotel().getInteractions().onTrigger(Item.getBase().Interaction, Session, Item, 1);
    }

}
