UNPKG

@cfwest/api-client

Version:

Unofficial CrossFire West ApiClient implementation.

30 lines (29 loc) 873 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WeaponCategoryMapperImpl = void 0; class WeaponCategoryMapperImpl { constructor() { this.mappings = new Map([ ['assault', 1], ['sniper', 2], ['smg', 3], ['mg', 4], ['shotgun', 5], ['pistol', 6], ['melee', 7], ['grenade', 8] ]); } mapWeaponCategoryNameToIndex(category) { return this.mappings.get(category) || -1; } mapWeaponCategoryIndexToName(categoryIndex) { this.mappings.forEach((index, categoryName) => { if (index === categoryIndex) { return categoryName; } }); return undefined; } } exports.WeaponCategoryMapperImpl = WeaponCategoryMapperImpl;