代码拉取完成,页面将自动刷新
同步操作将从 驯鹿者/ts_design_mode 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var GunType;
(function (GunType) {
GunType[GunType["AK"] = 0] = "AK";
GunType[GunType["M4A1"] = 1] = "M4A1";
})(GunType || (GunType = {}));
// interface Shootable {
// shoot();
// }
var Gun = /** @class */ (function () {
function Gun() {
}
return Gun;
}());
var AK47 = /** @class */ (function (_super) {
__extends(AK47, _super);
function AK47() {
return _super !== null && _super.apply(this, arguments) || this;
}
//具体产品 - AK47
AK47.prototype.shoot = function () {
console.log("ak47 shoot.");
};
return AK47;
}(Gun));
var M4A1 = /** @class */ (function (_super) {
__extends(M4A1, _super);
function M4A1() {
return _super !== null && _super.apply(this, arguments) || this;
}
//具体产品 - M4A1
M4A1.prototype.shoot = function () {
console.log("m4a1 shoot.");
};
return M4A1;
}(Gun));
var GunFactory = /** @class */ (function () {
function GunFactory() {
}
GunFactory.createGun = function (type) {
switch (type) {
case GunType.AK:
return new AK47();
case GunType.M4A1:
return new M4A1();
default:
throw Error("not support this gun yet");
}
};
return GunFactory;
}());
GunFactory.createGun(GunType.AK).shoot();
GunFactory.createGun(GunType.M4A1).shoot();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。