import { TILE_TYPES } from './Constants.js';

export const MISSION_TYPES = {
    ESCAPE: 'escape', // Objective is to find the exit
    QUEST: 'quest'    // Objective is to find the Objective Room
};

export class MissionConfig {
    /**
     * @param {Object} config - The mission configuration object
     * @param {string} config.id - Unique ID
     * @param {string} config.name - Display Name
     * @param {string} config.type - MISSION_TYPES.ESCAPE or .QUEST
     * @param {number} config.minTiles - Minimum tiles before the objective card is shuffled in
     */
    constructor(config) {
        this.id = config.id;
        this.name = config.name;
        this.type = config.type || MISSION_TYPES.ESCAPE;

        // For Campaign missions: "Force valid exit room after X tiles"
        // Use this to control when the "Target" card is inserted into the future deck
        this.minTiles = config.minTiles || 8;
    }

    /**
     * Determines which tile acts as the "Objective" for this mission.
     * In standard missions: It's the Objective Room.
     * In escape missions: It might be a specific generic room designated as the "Exit".
     */
    getTargetTileType() {
        if (this.type === MISSION_TYPES.QUEST) {
            return TILE_TYPES.OBJECTIVE_ROOM;
        } else {
            // In escape missions, any Room can be the exit, usually marked specifically
            return TILE_TYPES.ROOM;
        }
    }
}
