_internal.interfaces.store.IPurchaseable - vladzaharia/bitburner GitHub Wiki
_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.
| Name | Description |
|---|---|
P |
The purchase parameters for implementing classes. |
▸ canPurchase(params): boolean
Checks whether the user can purchase based on parameters params.
| Name | Type | Description |
|---|---|---|
params |
P |
Parameters for this transaction. |
boolean
Whether this transaction is possible.
_internal/interfaces/store.d.ts:21
▸ getAvailableMoney(): number
Gets the amount of money available to this store.
number
Available money according to specified budget.
_internal/interfaces/store.d.ts:13
▸ getPurchaseCost(params): number
Get cost of purchase with parameters params.
| Name | Type | Description |
|---|---|---|
params |
P |
Parameters for this transaction. |
number
Cost of the transaction.
_internal/interfaces/store.d.ts:29
▸ purchase(params): Promise<boolean>
Purchase an item with parameters params if there is money available.
| Name | Type | Description |
|---|---|---|
params |
P |
Parameters for this transaction. |
Promise<boolean>
Whether the transaction was successful.