import Room from '../room';

export default class RoomBuilder {
    constructor() {
        this.room = new Room();
    }

    withID(ID) {
        this.room.id = ID;
        return this;
    }

    withTitle(title) {
        this.room.title = title;
        return this;
    }

    withFirstDescription(description) {
        this.room.firstDescription = description;
        return this;
    }

    withDescription(description) {
        this.room.description = description;
        return this;
    }

    withExit(direction, roomID) {
        this.room.addExit(direction, roomID);
        return this;
    }

    withItem(itemID) {
        this.room.addItem(itemID);
        return this;
    }

    withEnterCallback(callback) {
        this.room.addEnterCallback(callback);
        return this;
    }

    withExitCallback(callback) {
        this.room.addExitCallback(callback);
        return this;
    }

    withEnterLogic(func) {
        this.room.addEnterLogic(func);
        return this;
    }

    withExitLogic(func) {
        this.room.addExitLogic(func);
        return this;
    }

    withTick(func) {
        this.room.addTickCallback(func);
        return this;
    }

    withMusic(file) {
        this.room.music = file;
        return this;
    }

    withAmbience(file) {
        this.room.ambience = file;
        return this;
    }

    withImpulse(file) {
        this.room.impulse = file;
        return this;
    }
    
    create() {
        return this.room;
    }
}