import FSInventoryManager from "./fs/libs/FSInventoryManager";
import FSXPHelper from "./fs/FSXPHelper";
import { SECURITY_CHIP_PRICE_1, SECURITY_CHIP_PRICE_16, SECURITY_CHIP_PRICE_32, SECURITY_CHIP_PRICE_64 } from "./fs/FSConstants";
import FSPlayerPerms from "./fs/libs/perms/FSPlayerPerms";
import PlayerHelper from "./PlayerHelper";
export default class ShopHelper {
    static buySecurityChip(player, amount) {
        const slotsRequired = Math.ceil(amount / 64);
        if (!FSPlayerPerms.sharedInstance().isAdmin(player)) {
            PlayerHelper.outputAdminAccessRequired(player);
            return false;
        }
        if (FSInventoryManager.hasInventorySpaceAvailable(player, slotsRequired, true)) {
            let price = ShopHelper.priceForSecurityChip(amount);
            if (FSXPHelper.doesPlayerHaveEnoughXP(player, price, true, true)) {
                FSInventoryManager.addItem(player, "57d_sbunk:security_chip", amount, false);
                return true;
            }
        }
        return false;
    }
    static priceForSecurityChip(amount) {
        let price = -1;
        switch (amount) {
            case 1: {
                price = SECURITY_CHIP_PRICE_1;
                break;
            }
            case 16: {
                price = SECURITY_CHIP_PRICE_16;
                break;
            }
            case 32: {
                price = SECURITY_CHIP_PRICE_32;
                break;
            }
            case 64: {
                price = SECURITY_CHIP_PRICE_64;
                break;
            }
        }
        if (price === -1) {
            price = SECURITY_CHIP_PRICE_1 * amount;
        }
        return price;
    }
}

//# sourceMappingURL=../../../_SBUNK_BPDebug/fs_sbunk/ShopHelper.js.map
