add productCategoryToInventoryBin

This commit is contained in:
Sainan 2025-03-15 21:35:50 +01:00
parent 56a372ee6f
commit 7a52337af7
2 changed files with 34 additions and 1 deletions

View File

@ -172,6 +172,38 @@ export const getInventory = async (
return inventory; return inventory;
}; };
export const productCategoryToInventoryBin = (productCategory: string): InventorySlot | undefined => {
switch (productCategory) {
case "Suits":
return InventorySlot.SUITS;
case "Pistols":
case "LongGuns":
case "Melee":
return InventorySlot.WEAPONS;
case "Sentinels":
case "SentinelWeapons":
case "KubrowPets":
case "MoaPets":
return InventorySlot.SENTINELS;
case "SpaceSuits":
case "Hoverboards":
return InventorySlot.SPACESUITS;
case "SpaceGuns":
case "SpaceMelee":
return InventorySlot.SPACEWEAPONS;
case "OperatorAmps":
return InventorySlot.AMPS;
case "CrewShipWeapons":
case "CrewShipWeaponSkins":
return InventorySlot.RJ_COMPONENT_AND_ARMAMENTS;
case "MechSuits":
return InventorySlot.MECHSUITS;
case "CrewMembers":
return InventorySlot.CREWMEMBERS;
}
return undefined;
};
export const occupySlot = ( export const occupySlot = (
inventory: TInventoryDatabaseDocument, inventory: TInventoryDatabaseDocument,
bin: InventorySlot, bin: InventorySlot,

View File

@ -459,7 +459,8 @@ export enum InventorySlot {
PVE_LOADOUTS = "PveBonusLoadoutBin", PVE_LOADOUTS = "PveBonusLoadoutBin",
SENTINELS = "SentinelBin", SENTINELS = "SentinelBin",
AMPS = "OperatorAmpBin", AMPS = "OperatorAmpBin",
RJ_COMPONENT_AND_ARMAMENTS = "CrewShipSalvageBin" RJ_COMPONENT_AND_ARMAMENTS = "CrewShipSalvageBin",
CREWMEMBERS = "CrewMemberBin"
} }
export interface ISlots { export interface ISlots {