feat: expand profiles and weapon configuration
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export const WEAPON_CATEGORIES = ['Shotgun', 'Rifle', 'MMR', 'AR', 'LMG', 'SMG'] as const;
|
||||
|
||||
export type WeaponCategory = (typeof WEAPON_CATEGORIES)[number];
|
||||
|
||||
export function attachWeaponCategoryBonuses<
|
||||
TWeapon extends { category: unknown },
|
||||
TBonus extends { weapon_category: unknown }
|
||||
>(weapons: TWeapon[], bonuses: TBonus[]) {
|
||||
return weapons.map((weapon) => ({
|
||||
...weapon,
|
||||
baseBonuses: bonuses.filter((bonus) => bonus.weapon_category === weapon.category)
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user