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

import gnu.trove.map.hash.THashMap;
import net.cobem.grizzly.communication.EventResponse;
import net.cobem.grizzly.communication.HeaderLibrary;
import net.cobem.grizzly.habbohotel.sessions.Session;

public class SendRoomUserStatusesComposer {
    public static EventResponse compose(THashMap<Integer, Session> Party) {
        EventResponse Message = new EventResponse();

        Message.Initialize(HeaderLibrary.InitializeRoomUserStatusesEvent);
        Message.addInt(Party.size());

        for (Session Actor : Party.values()) {
            Message.addInt(Actor.getHabbo().getID());
            Message.addInt(Actor.getActor().CurrentPosition.X);
            Message.addInt(Actor.getActor().CurrentPosition.Y);
            Message.addString(Double.toString(Actor.getActor().CurrentPosition.Z));
            Message.addInt(Actor.getActor().Rotation);
            Message.addInt(Actor.getActor().Rotation);
            Message.addString("/flatctrl 4/");
        }

        return Message;
    }
}
