Add optional count parameter to hashCost and spendHashes

This commit is contained in:
Undeemiss
2022-05-31 21:13:03 -05:00
parent 6f017bf4f6
commit f0dc532513
5 changed files with 48 additions and 34 deletions

View File

@@ -2690,9 +2690,10 @@ export interface Hacknet {
* }
* ```
* @param upgName - Name of the upgrade of Hacknet Node.
* @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.
* @returns Number of hashes required for the specified upgrade.
*/
hashCost(upgName: string): number;
hashCost(upgName: string, count?: number): number;
/**
* Purchase a hash upgrade.
@@ -2722,9 +2723,11 @@ export interface Hacknet {
* ```
* @param upgName - Name of the upgrade of Hacknet Node.
* @param upgTarget - Object to which upgrade applies. Required for certain upgrades.
* @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.
* For compatability reasons, upgTarget must be specified, even if it is not used, in order to specify count.
* @returns True if the upgrade is successfully purchased, and false otherwise..
*/
spendHashes(upgName: string, upgTarget?: string): boolean;
spendHashes(upgName: string, upgTarget?: string, count?: number): boolean;
/**
* Get the list of hash upgrades