mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
See description
Reverted ToastVariant back to an enum internally. Still exposed to player as just possible strings. Changed all 1-line documentation comments to actually be 1-line. Moved some because they were not providing documentation for the thing they were trying to.
This commit is contained in:
@@ -120,16 +120,12 @@ export class HacknetNode implements IHacknetNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize the current object to a JSON save state.
|
||||
*/
|
||||
/** Serialize the current object to a JSON save state. */
|
||||
toJSON(): IReviverValue {
|
||||
return Generic_toJSON("HacknetNode", this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiatizes a HacknetNode object from a JSON save state.
|
||||
*/
|
||||
/** Initiatizes a HacknetNode object from a JSON save state. */
|
||||
static fromJSON(value: IReviverValue): HacknetNode {
|
||||
return Generic_fromJSON(HacknetNode, value.data);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
* Hacknet Servers - Reworked Hacknet Node mechanic for BitNode-9
|
||||
*/
|
||||
import { CONSTANTS } from "../Constants";
|
||||
|
||||
import { IHacknetNode } from "./IHacknetNode";
|
||||
@@ -30,6 +27,7 @@ interface IConstructorParams {
|
||||
organizationName?: string;
|
||||
}
|
||||
|
||||
/** Hacknet Servers - Reworked Hacknet Node mechanic for BitNode-9 */
|
||||
export class HacknetServer extends BaseServer implements IHacknetNode {
|
||||
// Cache level. Affects hash Capacity
|
||||
cache = 1;
|
||||
|
||||
@@ -28,9 +28,7 @@ export class HashManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic helper function for getting a multiplier from a HashUpgrade
|
||||
*/
|
||||
/** Generic helper function for getting a multiplier from a HashUpgrade */
|
||||
getMult(upgName: string): number {
|
||||
const upg = HashUpgrades[upgName];
|
||||
const currLevel = this.upgrades[upgName];
|
||||
@@ -42,18 +40,14 @@ export class HashManager {
|
||||
return 1 + (upg.value * currLevel) / 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* One of the Hash upgrades improves studying. This returns that multiplier
|
||||
*/
|
||||
/** One of the Hash upgrades improves studying. This returns that multiplier */
|
||||
getStudyMult(): number {
|
||||
const upgName = "Improve Studying";
|
||||
|
||||
return this.getMult(upgName);
|
||||
}
|
||||
|
||||
/**
|
||||
* One of the Hash upgrades improves gym training. This returns that multiplier
|
||||
*/
|
||||
/** One of the Hash upgrades improves gym training. This returns that multiplier */
|
||||
getTrainingMult(): number {
|
||||
const upgName = "Improve Gym Training";
|
||||
|
||||
@@ -69,9 +63,7 @@ export class HashManager {
|
||||
return upg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cost (in hashes) of an upgrade
|
||||
*/
|
||||
/** Get the cost (in hashes) of an upgrade */
|
||||
getUpgradeCost(upgName: string, count = 1): number {
|
||||
const upg = this.getUpgrade(upgName);
|
||||
const currLevel = this.upgrades[upgName];
|
||||
@@ -93,9 +85,7 @@ export class HashManager {
|
||||
this.updateCapacity(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverts an upgrade and refunds the hashes used to buy it
|
||||
*/
|
||||
/** Reverts an upgrade and refunds the hashes used to buy it */
|
||||
refundUpgrade(upgName: string, count = 1): void {
|
||||
const upg = HashUpgrades[upgName];
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/**
|
||||
* Object representing an upgrade that can be purchased with hashes
|
||||
*/
|
||||
/** Object representing an upgrade that can be purchased with hashes */
|
||||
export interface IConstructorParams {
|
||||
cost?: number;
|
||||
costPerLevel: number;
|
||||
@@ -26,9 +24,7 @@ export class HashUpgrade {
|
||||
*/
|
||||
costPerLevel = 0;
|
||||
|
||||
/**
|
||||
* Description of what the upgrade does
|
||||
*/
|
||||
/** Description of what the upgrade does */
|
||||
desc = "";
|
||||
|
||||
/**
|
||||
@@ -37,7 +33,7 @@ export class HashUpgrade {
|
||||
*/
|
||||
hasTargetServer = false;
|
||||
|
||||
// Name of upgrade
|
||||
/** Name of upgrade */
|
||||
name = "";
|
||||
|
||||
// Generic value used to indicate the potency/amount of this upgrade's effect
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
* Root React Component for the Hacknet Node UI
|
||||
*/
|
||||
import React, { useState, useEffect } from "react";
|
||||
|
||||
import { GeneralInfo } from "./GeneralInfo";
|
||||
@@ -29,6 +26,7 @@ import Grid from "@mui/material/Grid";
|
||||
import Button from "@mui/material/Button";
|
||||
import { Box } from "@mui/material";
|
||||
|
||||
/** Root React Component for the Hacknet Node UI */
|
||||
export function HacknetRoot(): React.ReactElement {
|
||||
const [open, setOpen] = useState(false);
|
||||
const setRerender = useState(false)[1];
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
* Create the pop-up for purchasing upgrades with hashes
|
||||
*/
|
||||
import React, { useState, useEffect } from "react";
|
||||
|
||||
import { HashUpgrades } from "../HashUpgrades";
|
||||
@@ -16,6 +13,7 @@ interface IProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
/** Create the pop-up for purchasing upgrades with hashes */
|
||||
export function HashUpgradeModal(props: IProps): React.ReactElement {
|
||||
const setRerender = useState(false)[1];
|
||||
function rerender(): void {
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
* React Component for the button that is used to purchase new Hacknet Nodes
|
||||
*/
|
||||
import React from "react";
|
||||
|
||||
import { hasHacknetServers, hasMaxNumberHacknetServers } from "../HacknetHelpers";
|
||||
@@ -15,6 +12,7 @@ interface IProps {
|
||||
cost: number;
|
||||
}
|
||||
|
||||
/** React Component for the button that is used to purchase new Hacknet Nodes */
|
||||
export function PurchaseButton(props: IProps): React.ReactElement {
|
||||
const cost = props.cost;
|
||||
let text;
|
||||
|
||||
Reference in New Issue
Block a user