_internal.interfaces.store.IPurchaseable - vladzaharia/bitburner GitHub Wiki

Interface: IPurchaseable<P>

_internal/interfaces/store.IPurchaseable

Represents a class capable of purchasing and selling, with a percentage of available money allocated to it.

interface

template The sell parameters for implementing classes.

Type parameters

Name Description
P The purchase parameters for implementing classes.

Implemented by

Table of contents

Methods

Methods

canPurchase

canPurchase(params): boolean

Checks whether the user can purchase based on parameters params.

Parameters

Name Type Description
params P Parameters for this transaction.

Returns

boolean

Whether this transaction is possible.

Defined in

_internal/interfaces/store.d.ts:21


getAvailableMoney

getAvailableMoney(): number

Gets the amount of money available to this store.

Returns

number

Available money according to specified budget.

Defined in

_internal/interfaces/store.d.ts:13


getPurchaseCost

getPurchaseCost(params): number

Get cost of purchase with parameters params.

Parameters

Name Type Description
params P Parameters for this transaction.

Returns

number

Cost of the transaction.

Defined in

_internal/interfaces/store.d.ts:29


purchase

purchase(params): Promise<boolean>

Purchase an item with parameters params if there is money available.

Parameters

Name Type Description
params P Parameters for this transaction.

Returns

Promise<boolean>

Whether the transaction was successful.

Defined in

_internal/interfaces/store.d.ts:37

⚠️ **GitHub.com Fallback** ⚠️