package thb.jeanluc.adventure.loader;

import thb.jeanluc.adventure.loader.dto.RoomDto;
import thb.jeanluc.adventure.model.Room;

/**
 * Builds an empty {@link Room} shell from a DTO. Exits, items, and NPCs
 * are wired in a later phase by {@link ReferenceResolver}.
 */
public final class RoomFactory {

    private RoomFactory() {
    }

    /**
     * Builds a fresh room with no exits, items, or NPCs.
     *
     * @param dto data read from {@code rooms.yaml}; must not be null
     * @return the freshly built room shell
     */
    public static Room shellFromDto(RoomDto dto) {
        Room room = new Room(dto.id(), dto.name(), dto.description());
        room.setDark(Boolean.TRUE.equals(dto.dark()));
        room.setMusic(dto.music());
        return room;
    }
}
