"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimedEntity = exports.Entity = void 0;
class Entity {
    constructor(config = null) {
        this.TYPE = "Entity";
        this.uuid = Entity.counter++;
        this._parent = null;
        config = config || {};
        if (config.metadata)
            throw new Error("See where metadata is being passed");
    }
    get parent() {
        return this._parent;
    }
    setParent(parent) {
        this._parent = parent;
    }
    debugValue() {
        return { type: this.TYPE };
    }
    toString() {
        return `Entity(id = ${this.uuid})`;
    }
    equals(another, expect = false) {
        if (this.TYPE != another.TYPE)
            return false;
        return true;
    }
    clone() {
        const out = this.newInstance();
        this.copyTo(out);
        return out;
    }
    copyTo(another) {
    }
    newInstance() {
        return new this.constructor();
    }
}
exports.Entity = Entity;
Entity.counter = 0;
class TimedEntity extends Entity {
    constructor() {
        super(...arguments);
        this.TYPE = "TimedEntity";
    }
    equals(another) {
        return super.equals(another) && this.duration.equals(another.duration);
    }
}
exports.TimedEntity = TimedEntity;
//# sourceMappingURL=entity.js.map