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

import net.cobem.grizzly.Grizzly;
import net.cobem.grizzly.communication.EventResponse;
import net.cobem.grizzly.communication.HeaderLibrary;

public class SendOfferConfigurationsComposer
{
    public static EventResponse compose() {
        EventResponse Message = new EventResponse();

        Message.Initialize(HeaderLibrary.SendOffersConfigurationEvent);

        Message.addInt(new Integer(Grizzly.getConfig().get("habbo.catalog.max.amount.offerable")));
        Message.addInt(new Integer(Grizzly.getConfig().get("habbo.catalog.offers.every.x")));
        Message.addInt(new Integer(Grizzly.getConfig().get("habbo.catalog.increment.per.offer")));
        Message.addInt(new Integer(Grizzly.getConfig().get("habbo.catalog.offer.incrementor")));
        Message.addInt(Grizzly.getConfig().get("habbo.catalog.offer.exceptions").split(",").length);

        for(String Exception : Grizzly.getConfig().get("habbo.catalog.offer.exceptions").split(",")) {
            Message.addInt(new Integer(Exception));
        }

        return Message;
    }
}
