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

import net.cobem.grizzly.communication.EventResponse;
import net.cobem.grizzly.communication.HeaderLibrary;
import net.cobem.grizzly.habbohotel.rooms.robots.Robot;
import net.cobem.grizzly.habbohotel.rooms.robots.RobotHandler;

public class SendRoomRobotsComposer {
    public static EventResponse compose(RobotHandler Handler) {
        EventResponse Message = new EventResponse();

        Message.Initialize(HeaderLibrary.InitializeRoomUsersEvent);
        Message.addInt(Handler.count());

        for (Robot Bot : Handler.getRobots().values()) {
            Message.addInt(Bot.ID);
            Message.addString(Bot.Name);
            Message.addString(Bot.Motto);
            Message.addString(Bot.Look);
            Message.addInt(Bot.ID);
            Message.addInt(Bot.X);
            Message.addInt(Bot.Y);
            Message.addString(Double.toString(Bot.Height));
            Message.addInt(Bot.Rotation);
            Message.addInt(1);
            Message.addString("m");
            Message.addInt(-1);
            Message.addInt(-1);
            Message.addInt(0);
            Message.addInt(9001);
        }

        return Message;
    }
}
