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 SendBadgesComposer {
    public static EventResponse compose(List<BadgeObject> Badges, List<BadgeObject> EquippedBadges) {
        EventResponse Message = new EventResponse();

        Message.Initialize(HeaderLibrary.InitializeBadgesEvent);

        Message.addInt(Badges.size());  //Badge Count

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

        Message.addInt(EquippedBadges.size());

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

        return Message;
    }
}
