models/profession.js

import Model from "./model.js";

/**
 * Represents a character profession with associated traits, equipment, and behavioral patterns.
 * Defines the template for creating characters with specific professional backgrounds.
 *
 * @extends Model
 */
class Profession extends Model {
  /**
   * Creates a new Profession instance.
   *
   * @constructor
   * @param {Object} [params={}] - Configuration parameters for the profession
   * @param {String[]} [params.names=[]] - Possible names for this profession (all are synonyms)
   * @param {String} [params.kit=null] - A tag query to select an equipment kit for this profession
   * @param {String[]} [params.seeds=[]] - Starting traits common to all characters holding this profession
   * @param {Object} [params.traits={}] - Traits that this character may be trained or experienced in
   * @param {String[]} [params.tags=[]] - Array of tags to categorize this profession
   * @param {String} [params.frequency="common"] - How commonly this profession appears (common, rare, etc.)
   * @param {Function} [params.postprocess] - Optional post-processing function to apply after character creation
   */
  constructor({
    names = [],
    kit = null,
    seeds = [],
    traits = {},
    tags = [],
    frequency = "common",
    postprocess,
  } = {}) {
    super({ tags });
    this.names = names;
    this.kit = kit;
    this.seeds = seeds;
    this.traits = traits;
    this.frequency = frequency;
    this.postprocess = postprocess;
  }
}

export default Profession;