mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 20:55:44 +01:00
DOC: Specify optional parameters in hacknet functions (#515)
This commit is contained in:
parent
75706d273a
commit
2e9dc32deb
@ -9,7 +9,7 @@ Calculate the cost of upgrading hacknet node cache.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getCacheUpgradeCost(index: number, n: number): number;
|
getCacheUpgradeCost(index: number, n?: number): number;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -17,7 +17,7 @@ getCacheUpgradeCost(index: number, n: number): number;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| index | number | Index/Identifier of Hacknet Node. |
|
| index | number | Index/Identifier of Hacknet Node. |
|
||||||
| n | number | Number of times to upgrade cache. Must be positive. Rounded to nearest integer. |
|
| n | number | _(Optional)_ Number of times to upgrade cache. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Calculate the cost of upgrading hacknet node cores.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getCoreUpgradeCost(index: number, n: number): number;
|
getCoreUpgradeCost(index: number, n?: number): number;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -17,7 +17,7 @@ getCoreUpgradeCost(index: number, n: number): number;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| index | number | Index/Identifier of Hacknet Node. |
|
| index | number | Index/Identifier of Hacknet Node. |
|
||||||
| n | number | Number of times to upgrade cores. Must be positive. Rounded to nearest integer. |
|
| n | number | _(Optional)_ Number of times to upgrade cores. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Calculate the cost of upgrading hacknet node levels.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getLevelUpgradeCost(index: number, n: number): number;
|
getLevelUpgradeCost(index: number, n?: number): number;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -17,7 +17,7 @@ getLevelUpgradeCost(index: number, n: number): number;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| index | number | Index/Identifier of Hacknet Node. |
|
| index | number | Index/Identifier of Hacknet Node. |
|
||||||
| n | number | Number of levels to upgrade. Must be positive. Rounded to nearest integer. |
|
| n | number | _(Optional)_ Number of levels to upgrade. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Calculate the cost of upgrading hacknet node RAM.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getRamUpgradeCost(index: number, n: number): number;
|
getRamUpgradeCost(index: number, n?: number): number;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -17,7 +17,7 @@ getRamUpgradeCost(index: number, n: number): number;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| index | number | Index/Identifier of Hacknet Node. |
|
| index | number | Index/Identifier of Hacknet Node. |
|
||||||
| n | number | Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. |
|
| n | number | _(Optional)_ Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Upgrade the cache of a hacknet node.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
upgradeCache(index: number, n: number): boolean;
|
upgradeCache(index: number, n?: number): boolean;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -17,7 +17,7 @@ upgradeCache(index: number, n: number): boolean;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| index | number | Index/Identifier of Hacknet Node. |
|
| index | number | Index/Identifier of Hacknet Node. |
|
||||||
| n | number | Number of cache levels to purchase. Must be positive. Rounded to nearest integer. |
|
| n | number | _(Optional)_ Number of cache levels to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Upgrade the core of a hacknet node.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
upgradeCore(index: number, n: number): boolean;
|
upgradeCore(index: number, n?: number): boolean;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -17,7 +17,7 @@ upgradeCore(index: number, n: number): boolean;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| index | number | Index/Identifier of Hacknet Node. |
|
| index | number | Index/Identifier of Hacknet Node. |
|
||||||
| n | number | Number of cores to purchase. Must be positive. Rounded to nearest integer. |
|
| n | number | _(Optional)_ Number of cores to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Upgrade the level of a hacknet node.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
upgradeLevel(index: number, n: number): boolean;
|
upgradeLevel(index: number, n?: number): boolean;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -17,7 +17,7 @@ upgradeLevel(index: number, n: number): boolean;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| index | number | Index/Identifier of Hacknet Node. |
|
| index | number | Index/Identifier of Hacknet Node. |
|
||||||
| n | number | Number of levels to purchase. Must be positive. Rounded to nearest integer. |
|
| n | number | _(Optional)_ Number of levels to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Upgrade the RAM of a hacknet node.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
upgradeRam(index: number, n: number): boolean;
|
upgradeRam(index: number, n?: number): boolean;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -17,7 +17,7 @@ upgradeRam(index: number, n: number): boolean;
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| index | number | Index/Identifier of Hacknet Node. |
|
| index | number | Index/Identifier of Hacknet Node. |
|
||||||
| n | number | Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. |
|
| n | number | _(Optional)_ Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
32
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
32
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -2405,10 +2405,10 @@ export interface Hacknet {
|
|||||||
* Returns false otherwise.
|
* Returns false otherwise.
|
||||||
*
|
*
|
||||||
* @param index - Index/Identifier of Hacknet Node.
|
* @param index - Index/Identifier of Hacknet Node.
|
||||||
* @param n - Number of levels to purchase. Must be positive. Rounded to nearest integer.
|
* @param n - Number of levels to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
|
||||||
* @returns True if the Hacknet Node’s level is successfully upgraded, false otherwise.
|
* @returns True if the Hacknet Node’s level is successfully upgraded, false otherwise.
|
||||||
*/
|
*/
|
||||||
upgradeLevel(index: number, n: number): boolean;
|
upgradeLevel(index: number, n?: number): boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upgrade the RAM of a hacknet node.
|
* Upgrade the RAM of a hacknet node.
|
||||||
@ -2425,10 +2425,10 @@ export interface Hacknet {
|
|||||||
* Returns false otherwise.
|
* Returns false otherwise.
|
||||||
*
|
*
|
||||||
* @param index - Index/Identifier of Hacknet Node.
|
* @param index - Index/Identifier of Hacknet Node.
|
||||||
* @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.
|
* @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
|
||||||
* @returns True if the Hacknet Node’s RAM is successfully upgraded, false otherwise.
|
* @returns True if the Hacknet Node’s RAM is successfully upgraded, false otherwise.
|
||||||
*/
|
*/
|
||||||
upgradeRam(index: number, n: number): boolean;
|
upgradeRam(index: number, n?: number): boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upgrade the core of a hacknet node.
|
* Upgrade the core of a hacknet node.
|
||||||
@ -2443,10 +2443,10 @@ export interface Hacknet {
|
|||||||
* Returns false otherwise.
|
* Returns false otherwise.
|
||||||
*
|
*
|
||||||
* @param index - Index/Identifier of Hacknet Node.
|
* @param index - Index/Identifier of Hacknet Node.
|
||||||
* @param n - Number of cores to purchase. Must be positive. Rounded to nearest integer.
|
* @param n - Number of cores to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
|
||||||
* @returns True if the Hacknet Node’s cores are successfully purchased, false otherwise.
|
* @returns True if the Hacknet Node’s cores are successfully purchased, false otherwise.
|
||||||
*/
|
*/
|
||||||
upgradeCore(index: number, n: number): boolean;
|
upgradeCore(index: number, n?: number): boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upgrade the cache of a hacknet node.
|
* Upgrade the cache of a hacknet node.
|
||||||
@ -2463,10 +2463,10 @@ export interface Hacknet {
|
|||||||
* Returns false otherwise.
|
* Returns false otherwise.
|
||||||
*
|
*
|
||||||
* @param index - Index/Identifier of Hacknet Node.
|
* @param index - Index/Identifier of Hacknet Node.
|
||||||
* @param n - Number of cache levels to purchase. Must be positive. Rounded to nearest integer.
|
* @param n - Number of cache levels to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
|
||||||
* @returns True if the Hacknet Node’s cache level is successfully upgraded, false otherwise.
|
* @returns True if the Hacknet Node’s cache level is successfully upgraded, false otherwise.
|
||||||
*/
|
*/
|
||||||
upgradeCache(index: number, n: number): boolean;
|
upgradeCache(index: number, n?: number): boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the cost of upgrading hacknet node levels.
|
* Calculate the cost of upgrading hacknet node levels.
|
||||||
@ -2479,10 +2479,10 @@ export interface Hacknet {
|
|||||||
* If the specified Hacknet Node is already at max level, then Infinity is returned.
|
* If the specified Hacknet Node is already at max level, then Infinity is returned.
|
||||||
*
|
*
|
||||||
* @param index - Index/Identifier of Hacknet Node.
|
* @param index - Index/Identifier of Hacknet Node.
|
||||||
* @param n - Number of levels to upgrade. Must be positive. Rounded to nearest integer.
|
* @param n - Number of levels to upgrade. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
|
||||||
* @returns Cost of upgrading the specified Hacknet Node.
|
* @returns Cost of upgrading the specified Hacknet Node.
|
||||||
*/
|
*/
|
||||||
getLevelUpgradeCost(index: number, n: number): number;
|
getLevelUpgradeCost(index: number, n?: number): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the cost of upgrading hacknet node RAM.
|
* Calculate the cost of upgrading hacknet node RAM.
|
||||||
@ -2495,10 +2495,10 @@ export interface Hacknet {
|
|||||||
* If the specified Hacknet Node already has max RAM, then Infinity is returned.
|
* If the specified Hacknet Node already has max RAM, then Infinity is returned.
|
||||||
*
|
*
|
||||||
* @param index - Index/Identifier of Hacknet Node.
|
* @param index - Index/Identifier of Hacknet Node.
|
||||||
* @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.
|
* @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
|
||||||
* @returns Cost of upgrading the specified Hacknet Node's RAM.
|
* @returns Cost of upgrading the specified Hacknet Node's RAM.
|
||||||
*/
|
*/
|
||||||
getRamUpgradeCost(index: number, n: number): number;
|
getRamUpgradeCost(index: number, n?: number): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the cost of upgrading hacknet node cores.
|
* Calculate the cost of upgrading hacknet node cores.
|
||||||
@ -2511,10 +2511,10 @@ export interface Hacknet {
|
|||||||
* If the specified Hacknet Node is already at max level, then Infinity is returned.
|
* If the specified Hacknet Node is already at max level, then Infinity is returned.
|
||||||
*
|
*
|
||||||
* @param index - Index/Identifier of Hacknet Node.
|
* @param index - Index/Identifier of Hacknet Node.
|
||||||
* @param n - Number of times to upgrade cores. Must be positive. Rounded to nearest integer.
|
* @param n - Number of times to upgrade cores. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
|
||||||
* @returns Cost of upgrading the specified Hacknet Node's number of cores.
|
* @returns Cost of upgrading the specified Hacknet Node's number of cores.
|
||||||
*/
|
*/
|
||||||
getCoreUpgradeCost(index: number, n: number): number;
|
getCoreUpgradeCost(index: number, n?: number): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the cost of upgrading hacknet node cache.
|
* Calculate the cost of upgrading hacknet node cache.
|
||||||
@ -2529,10 +2529,10 @@ export interface Hacknet {
|
|||||||
* If the specified Hacknet Node is already at max level, then Infinity is returned.
|
* If the specified Hacknet Node is already at max level, then Infinity is returned.
|
||||||
*
|
*
|
||||||
* @param index - Index/Identifier of Hacknet Node.
|
* @param index - Index/Identifier of Hacknet Node.
|
||||||
* @param n - Number of times to upgrade cache. Must be positive. Rounded to nearest integer.
|
* @param n - Number of times to upgrade cache. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
|
||||||
* @returns Cost of upgrading the specified Hacknet Node's cache.
|
* @returns Cost of upgrading the specified Hacknet Node's cache.
|
||||||
*/
|
*/
|
||||||
getCacheUpgradeCost(index: number, n: number): number;
|
getCacheUpgradeCost(index: number, n?: number): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the total number of hashes stored.
|
* Get the total number of hashes stored.
|
||||||
|
Loading…
Reference in New Issue
Block a user