From ef87174e3fa30aefd179913febc52b0a286a4a61 Mon Sep 17 00:00:00 2001 From: Naga <92240446+NagaOuroboros@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:20:20 -0500 Subject: [PATCH] DOCUMENTATION: Clarify the return descriptions of 'getPurchasedServerCost' and 'getPurchasedServerUpgradeCost' to include the returns for invalid inputs. (#1884) --- markdown/bitburner.ns.getpurchasedservercost.md | 2 +- markdown/bitburner.ns.getpurchasedserverupgradecost.md | 2 +- src/ScriptEditor/NetscriptDefinitions.d.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/markdown/bitburner.ns.getpurchasedservercost.md b/markdown/bitburner.ns.getpurchasedservercost.md index f2e44bf8e2..75b8f112dc 100644 --- a/markdown/bitburner.ns.getpurchasedservercost.md +++ b/markdown/bitburner.ns.getpurchasedservercost.md @@ -22,7 +22,7 @@ getPurchasedServerCost(ram: number): number; number -The cost to purchase a server with the specified amount of ram. +The cost to purchase a server with the specified amount of ram, or returns Infinity if ram is not a valid amount. ## Remarks diff --git a/markdown/bitburner.ns.getpurchasedserverupgradecost.md b/markdown/bitburner.ns.getpurchasedserverupgradecost.md index 5d99b17acb..fec2fa7df0 100644 --- a/markdown/bitburner.ns.getpurchasedserverupgradecost.md +++ b/markdown/bitburner.ns.getpurchasedserverupgradecost.md @@ -23,7 +23,7 @@ getPurchasedServerUpgradeCost(hostname: string, ram: number): number; number -The price to upgrade. +The price to upgrade or -1 if either input is not valid, i.e. hostname is not the name of a purchased server or ram is not a valid amount. ## Remarks diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index fc216d9dee..dee6552063 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -7164,7 +7164,7 @@ export interface NS { * ns.tprint(`A purchased server with ${ns.formatRam(ram)} costs $${ns.formatNumber(cost)}`); * ``` * @param ram - Amount of RAM of a potential purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20). - * @returns The cost to purchase a server with the specified amount of ram. + * @returns The cost to purchase a server with the specified amount of ram, or returns Infinity if ram is not a valid amount. */ getPurchasedServerCost(ram: number): number; @@ -7214,7 +7214,7 @@ export interface NS { * * @param hostname - Hostname of the server to upgrade. * @param ram - Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20). - * @returns The price to upgrade. + * @returns The price to upgrade or -1 if either input is not valid, i.e. hostname is not the name of a purchased server or ram is not a valid amount. */ getPurchasedServerUpgradeCost(hostname: string, ram: number): number;