UNPKG

awayjs-display

Version:
48 lines 1.7 kB
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var AssetBase_1 = require("awayjs-core/lib/library/AssetBase"); var AbstractMethodError_1 = require("awayjs-core/lib/errors/AbstractMethodError"); /** * PrefabBase is an abstract base class for prefabs, which are prebuilt display objects that allow easy cloning and updating */ var PrefabBase = (function (_super) { __extends(PrefabBase, _super); // public _pBatchObjects:Array<BatchObject> = new Array<BatchObject>(); /** * Creates a new PrefabBase object. */ function PrefabBase() { _super.call(this); this._pObjects = new Array(); } /** * Returns a display object generated from this prefab */ PrefabBase.prototype.getNewObject = function () { var object = this._pCreateObject(); this._pObjects.push(object); return object; }; // public getNewBatchObject():BatchObject // { // var object:BatchObject = this._pCreateBatchObject(); // // this._pBatchObjects.push(object); // // return object; // } PrefabBase.prototype._pCreateObject = function () { throw new AbstractMethodError_1.default(); }; PrefabBase.prototype._iValidate = function () { // To be overridden when necessary }; return PrefabBase; }(AssetBase_1.default)); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = PrefabBase; //# sourceMappingURL=PrefabBase.js.map