DOC: Specify optional parameters in hacknet functions (#515)

This commit is contained in:
Nikolai Korolev 2023-05-18 06:28:56 +01:00 committed by GitHub
parent 75706d273a
commit 2e9dc32deb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 32 deletions

@ -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:**

@ -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 Nodes level is successfully upgraded, false otherwise. * @returns True if the Hacknet Nodes 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 Nodes RAM is successfully upgraded, false otherwise. * @returns True if the Hacknet Nodes 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 Nodes cores are successfully purchased, false otherwise. * @returns True if the Hacknet Nodes 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 Nodes cache level is successfully upgraded, false otherwise. * @returns True if the Hacknet Nodes 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.