Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var __extends = (this && this.__extends) || (function () {
  2.     var extendStatics = function (d, b) {
  3.         extendStatics = Object.setPrototypeOf ||
  4.             ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  5.             function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6.         return extendStatics(d, b);
  7.     };
  8.     return function (d, b) {
  9.         extendStatics(d, b);
  10.         function __() { this.constructor = d; }
  11.         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12.     };
  13. })();
  14. var Melon = /** @class */ (function () {
  15.     function Melon(weight, melonSort) {
  16.         this.weight = weight;
  17.         this.melonSort = melonSort;
  18.     }
  19.     return Melon;
  20. }());
  21. var Watermelon = /** @class */ (function (_super) {
  22.     __extends(Watermelon, _super);
  23.     function Watermelon(weight, melonSort) {
  24.         var _this = _super.call(this, weight, melonSort) || this;
  25.         _this.elementIndex = weight * melonSort.length;
  26.         return _this;
  27.     }
  28.     Watermelon.prototype.toString = function () {
  29.         return "Element: Water\nSort: " + this.melonSort + "\nElement Index: " + this.elementIndex;
  30.     };
  31.     return Watermelon;
  32. }(Melon));
  33. var Firemelon = /** @class */ (function (_super) {
  34.     __extends(Firemelon, _super);
  35.     function Firemelon(weight, melonSort) {
  36.         var _this = _super.call(this, weight, melonSort) || this;
  37.         _this.elementIndex = weight * melonSort.length;
  38.         return _this;
  39.     }
  40.     Firemelon.prototype.toString = function () {
  41.         return "Element: Fire\nSort: " + this.melonSort + "\nElement Index: " + this.elementIndex;
  42.     };
  43.     return Firemelon;
  44. }(Melon));
  45. var Earthmelon = /** @class */ (function (_super) {
  46.     __extends(Earthmelon, _super);
  47.     function Earthmelon(weight, melonSort) {
  48.         var _this = _super.call(this, weight, melonSort) || this;
  49.         _this.elementIndex = weight * melonSort.length;
  50.         return _this;
  51.     }
  52.     Earthmelon.prototype.toString = function () {
  53.         return "Element: Earth\nSort: " + this.melonSort + "\nElement Index: " + this.elementIndex;
  54.     };
  55.     return Earthmelon;
  56. }(Melon));
  57. var Airmelon = /** @class */ (function (_super) {
  58.     __extends(Airmelon, _super);
  59.     function Airmelon(weight, melonSort) {
  60.         var _this = _super.call(this, weight, melonSort) || this;
  61.         _this.elementIndex = weight * melonSort.length;
  62.         return _this;
  63.     }
  64.     Airmelon.prototype.toString = function () {
  65.         return "Element: Air\nSort: " + this.melonSort + "\nElement Index: " + this.elementIndex;
  66.     };
  67.     return Airmelon;
  68. }(Melon));
  69. var Melolemonmelon = /** @class */ (function (_super) {
  70.     __extends(Melolemonmelon, _super);
  71.     function Melolemonmelon(weight, melonSort) {
  72.         var _this = _super.call(this, weight, melonSort) || this;
  73.         _this.element = ["Water", "Fire", "Earth", "Air"];
  74.         return _this;
  75.     }
  76.     Melolemonmelon.prototype.morph = function () {
  77.         var a = this.element.shift();
  78.         this.element.push(a);
  79.         return this;
  80.     };
  81.     Melolemonmelon.prototype.toString = function () {
  82.         return "Element: " + this.element[0] + "\nSort: " + this.melonSort + "\nElement Index: " + this.elementIndex;
  83.     };
  84.     return Melolemonmelon;
  85. }(Watermelon));
  86. var test = new Melon(100, "Test");
  87. var airmelon = new Airmelon(12.5, "Kingsize");
  88. console.log(airmelon.toString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement