lol-api-js
Version:
Integration package LoL Riot API and your typescript/javascript
52 lines • 2.18 kB
JavaScript
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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var _1 = __importDefault(require("."));
var Match = /** @class */ (function (_super) {
__extends(Match, _super);
function Match(api_key, dataPath, metadata, info) {
var _this = _super.call(this, api_key, dataPath) || this;
/**
* Returns an Array of strings containing the paths to champions .jpg.
*
* @remarks
* This method is part of lol-api-js package from the Match class
*
* @returns an Array of strings with champion images paths
*
* @example
* const match = new Match();
* match.getMatch(puuid);
* const arrayOfPathImgs = match.getChampionsIcons();
*/
_this.getChampionsIcons = function () {
var champions = _this.info.participants.map(function (object) {
return _this.dataPath + "/img/champion/tiles/" + object.championName + "_0.jpg";
});
return champions;
};
_this.metadata = metadata;
_this.info = info;
return _this;
}
return Match;
}(_1.default));
exports.default = Match;
//# sourceMappingURL=match.js.map
;