camelot-unchained
Version:
Camelot Unchained Client Library
44 lines (35 loc) • 1.86 kB
JavaScript
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Injury = function () {
function Injury() {
var injury = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
_classCallCheck(this, Injury);
this.refresh(injury);
}
_createClass(Injury, [{
key: "refresh",
value: function refresh() {
var injury = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
this.part = injury.part || 0;
this.health = injury.health || 0;
this.maxHealth = injury.maxHealth || 0;
this.wounds = injury.wounds || 0;
this.empty = this.maxHealth == 0;
}
}], [{
key: "create",
value: function create() {
var a = new Injury();
return a;
}
}]);
return Injury;
}();
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Injury;