"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var CoreTestModelElement_1, CoreTestModel_1;
Object.defineProperty(exports, "__esModule", { value: true });
const mobx_1 = require("mobx");
const language_1 = require("../../language");
let CoreTestModelElement = CoreTestModelElement_1 = class CoreTestModelElement extends language_1.MobxModelElementImpl {
    constructor() {
        super();
        this.$id = "projectit-core-test-" + CoreTestModelElement_1.currentElementId++;
    }
    get model() {
        let con = this;
        while (con) {
            if (con instanceof CoreTestModel) {
                return con;
            }
            else if (con instanceof CoreTestModelElement_1) {
                con = con.container;
            }
            else {
                return null;
            }
        }
        return null;
    }
    equals(other) {
        if (this.$id === other.$id) {
            return true;
        }
        return false;
    }
};
CoreTestModelElement.currentElementId = 1;
CoreTestModelElement = CoreTestModelElement_1 = __decorate([
    language_1.model,
    __metadata("design:paramtypes", [])
], CoreTestModelElement);
exports.CoreTestModelElement = CoreTestModelElement;
let CoreTestModel = CoreTestModel_1 = class CoreTestModel extends CoreTestModelElement {
    constructor() {
        super();
        this.$typename = "CoreTestModel";
    }
    toString() {
        return "model " + this.name;
    }
    asString() {
        return "model " + this.name;
    }
    static create(name) {
        const result = new CoreTestModel_1();
        result.name = name;
        return result;
    }
};
__decorate([
    mobx_1.observable,
    __metadata("design:type", String)
], CoreTestModel.prototype, "name", void 0);
__decorate([
    language_1.observablelistpart,
    __metadata("design:type", Array)
], CoreTestModel.prototype, "units", void 0);
__decorate([
    language_1.observablelistpart,
    __metadata("design:type", Array)
], CoreTestModel.prototype, "functions", void 0);
CoreTestModel = CoreTestModel_1 = __decorate([
    language_1.model,
    __metadata("design:paramtypes", [])
], CoreTestModel);
exports.CoreTestModel = CoreTestModel;
class CoreTestUnit extends CoreTestModelElement {
    constructor() {
        super();
        this.$typename = "CoreTestUnit";
    }
    toString() {
        return "unit " + this.name;
    }
    asString() {
        return "unit " + this.name;
    }
    static create(name) {
        const result = new CoreTestUnit();
        result.name = name;
        return result;
    }
}
__decorate([
    mobx_1.observable,
    __metadata("design:type", String)
], CoreTestUnit.prototype, "name", void 0);
__decorate([
    language_1.observablelistpart,
    __metadata("design:type", Array)
], CoreTestUnit.prototype, "entities", void 0);
__decorate([
    language_1.observablelistpart,
    __metadata("design:type", Array)
], CoreTestUnit.prototype, "functions", void 0);
exports.CoreTestUnit = CoreTestUnit;
//# sourceMappingURL=CoreTestModel.js.map