import ObservedString from "../../../core/model/ObservedString.js";

/**
 * Represents any name, could be a name of an object, a person, a place etc.
 *
 * @example
 *  const name = new Name("John");
 *  name.getValue() // "John"
 *  name.set("Jane");
 *  name.getValue() // "Jane"
 *
 * @author Alex Goldring
 * @copyright Company Named Limited (c) 2026
 */
export class Name extends ObservedString {
    /**
     * Custom constructor is necessary for ECS to differentiate this component class from ObservedString
     * @param {string} [value]
     */
    constructor(value = "") {
        super(value);
    }

}

/**
 * @readonly
 * @type {string}
 */
Name.typeName = "Name";

/**
 * @readonly
 * @type {boolean}
 */
Name.prototype.isName = true;

// prefer named import instead
export default Name;

