Fix #1863: Add getHashUpgrades hacknet function

Adds a new functions ofr hacknet servers that returns the list of
available hash upgrades.
This commit is contained in:
Martin Fournier
2021-12-17 05:35:17 -05:00
parent 6c5842d2e7
commit 217b94d0a0
5 changed files with 87 additions and 0 deletions

View File

@@ -2290,6 +2290,22 @@ export interface Hacknet {
*/
spendHashes(upgName: string, upgTarget?: string): boolean;
/**
* Get the list of hash upgrades
* @remarks
* RAM cost: 0 GB
*
* This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).
*
* Returns the list of all available hash upgrades that can be used in the spendHashes function.
* @example
* ```ts
* const upgrades = hacknet.getHashUpgrades(); // ["Sell for Money","Sell for Corporation Funds",...]
* ```
* @returns An array containing the available upgrades
*/
getHashUpgrades(): string[];
/**
* Get the level of a hash upgrade.
* @remarks