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

import net.cobem.grizzly.communication.EventResponse;
import net.cobem.grizzly.communication.HeaderLibrary;
import net.cobem.grizzly.habbohotel.users.badges.BadgeObject;

import java.util.List;

public class SendUserBadgesComposer {
    public static EventResponse compose(int User, List<BadgeObject> Badges) {
        EventResponse Message = new EventResponse();

        Message.Initialize(HeaderLibrary.ViewUserBadgesEvent);
        Message.addInt(User);
        Message.addInt(Badges.size()); //badge count

        for (BadgeObject Obj : Badges) {
            Message.addInt(Obj.Slot);
            Message.addString(Obj.Code);
        }

        return Message;
    }
}
