mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-06 15:47:52 +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:
+4
-12
@@ -1,23 +1,15 @@
|
||||
/**
|
||||
* Class representing a City in the game
|
||||
*/
|
||||
import { CityName } from "./data/CityNames";
|
||||
import { LocationName } from "./data/LocationNames";
|
||||
|
||||
/** Class representing a City in the game */
|
||||
export class City {
|
||||
/**
|
||||
* List of all locations in this city
|
||||
*/
|
||||
/** List of all locations in this city */
|
||||
locations: LocationName[];
|
||||
|
||||
/**
|
||||
* Name of this city
|
||||
*/
|
||||
/** Name of this city */
|
||||
name: CityName;
|
||||
|
||||
/**
|
||||
* Metro map ascii art
|
||||
*/
|
||||
/** Metro map ascii art */
|
||||
asciiArt: string;
|
||||
|
||||
constructor(name: CityName, locations: LocationName[] = [], asciiArt = "") {
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
* Class representing a visitable location in the world
|
||||
*/
|
||||
import { CityName } from "./data/CityNames";
|
||||
import { LocationName } from "./data/LocationNames";
|
||||
import { LocationType } from "./LocationTypeEnum";
|
||||
@@ -21,6 +18,7 @@ export interface IConstructorParams {
|
||||
techVendorMinRam?: number;
|
||||
}
|
||||
|
||||
/** Class representing a visitable location in the world */
|
||||
export class Location {
|
||||
/**
|
||||
* Name of city this location is in. If this property is null, it means this i
|
||||
@@ -28,14 +26,10 @@ export class Location {
|
||||
*/
|
||||
city: CityName | null = null;
|
||||
|
||||
/**
|
||||
* Cost multiplier that influences how expensive a gym/university is
|
||||
*/
|
||||
/** Cost multiplier that influences how expensive a gym/university is */
|
||||
costMult = 0;
|
||||
|
||||
/**
|
||||
* Exp multiplier that influences how effective a gym/university is
|
||||
*/
|
||||
/** Exp multiplier that influences how effective a gym/university is */
|
||||
expMult = 0;
|
||||
|
||||
/**
|
||||
@@ -44,9 +38,7 @@ export class Location {
|
||||
*/
|
||||
infiltrationData?: IInfiltrationMetadata;
|
||||
|
||||
/**
|
||||
* Identifier for location
|
||||
*/
|
||||
/** Identifier for location */
|
||||
name: LocationName = LocationName.Void;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/**
|
||||
* Enum defining the different types of possible locations
|
||||
*/
|
||||
/** Enum defining the different types of possible locations */
|
||||
export enum LocationType {
|
||||
Company,
|
||||
Gym,
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/**
|
||||
* Names of all locations
|
||||
*/
|
||||
/** Names of all locations */
|
||||
export enum LocationName {
|
||||
// Aevum Locations
|
||||
AevumAeroCorp = "AeroCorp",
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
* React Component for a button that's used to apply for a job
|
||||
*/
|
||||
import * as React from "react";
|
||||
|
||||
import { Company } from "../../Company/Company";
|
||||
@@ -18,6 +15,7 @@ type IProps = {
|
||||
text: string;
|
||||
};
|
||||
|
||||
/** React Component for a button that's used to apply for a job */
|
||||
export function ApplyToJobButton(props: IProps): React.ReactElement {
|
||||
function getJobRequirementTooltip(): string {
|
||||
const pos = Player.getNextCompanyPosition(props.company, props.entryPosType);
|
||||
|
||||
@@ -47,17 +47,13 @@ export function CompanyLocation(props: IProps): React.ReactElement {
|
||||
const company = Companies[props.locName];
|
||||
if (company == null) throw new Error(`CompanyLocation component constructed with invalid company: ${props.locName}`);
|
||||
|
||||
/**
|
||||
* Reference to the Location that this component is being rendered for
|
||||
*/
|
||||
/** Reference to the Location that this component is being rendered for */
|
||||
const location = Locations[props.locName];
|
||||
if (location == null) {
|
||||
throw new Error(`CompanyLocation component constructed with invalid location: ${props.locName}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of company position that player holds, if applicable
|
||||
*/
|
||||
/** Name of company position that player holds, if applicable */
|
||||
const jobTitle = Player.jobs[props.locName] ? Player.jobs[props.locName] : null;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,9 +19,7 @@ type IState = {
|
||||
|
||||
//Todo: Make this a functional component
|
||||
export class HospitalLocation extends React.Component<Record<string, never>, IState> {
|
||||
/**
|
||||
* Stores button styling that sets them all to block display
|
||||
*/
|
||||
/** Stores button styling that sets them all to block display */
|
||||
btnStyle = { display: "block" };
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
* React Component for the popup used to purchase a new server.
|
||||
*/
|
||||
import React, { useState } from "react";
|
||||
import { purchaseServer } from "../../Server/ServerPurchases";
|
||||
import { numeralWrapper } from "../../ui/numeralFormat";
|
||||
@@ -20,6 +17,7 @@ interface IProps {
|
||||
rerender: () => void;
|
||||
}
|
||||
|
||||
/** React Component for the popup used to purchase a new server. */
|
||||
export function PurchaseServerModal(props: IProps): React.ReactElement {
|
||||
const [hostname, setHostname] = useState("");
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import { Router } from "../../ui/GameRoot";
|
||||
import { Player } from "../../Player";
|
||||
|
||||
import { dialogBoxCreate } from "../../ui/React/DialogBox";
|
||||
import { SnackbarEvents } from "../../ui/React/Snackbar";
|
||||
import { SnackbarEvents, ToastVariant } from "../../ui/React/Snackbar";
|
||||
import { N00dles } from "../../utils/helpers/N00dles";
|
||||
import { Exploit } from "../../Exploits/Exploit";
|
||||
import { applyAugmentation } from "../../Augmentation/AugmentationHelpers";
|
||||
@@ -45,9 +45,7 @@ export function SpecialLocation(props: IProps): React.ReactElement {
|
||||
const setRerender = useState(false)[1];
|
||||
const inBladeburner = Player.inBladeburner();
|
||||
|
||||
/**
|
||||
* Click handler for Bladeburner button at Sector-12 NSA
|
||||
*/
|
||||
/** Click handler for Bladeburner button at Sector-12 NSA */
|
||||
function handleBladeburner(): void {
|
||||
if (Player.inBladeburner()) {
|
||||
// Enter Bladeburner division
|
||||
@@ -73,9 +71,7 @@ export function SpecialLocation(props: IProps): React.ReactElement {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Click handler for Resleeving button at New Tokyo VitaLife
|
||||
*/
|
||||
/** Click handler for Resleeving button at New Tokyo VitaLife */
|
||||
function handleGrafting(): void {
|
||||
Router.toGrafting();
|
||||
}
|
||||
@@ -95,7 +91,7 @@ export function SpecialLocation(props: IProps): React.ReactElement {
|
||||
|
||||
function renderNoodleBar(): React.ReactElement {
|
||||
function EatNoodles(): void {
|
||||
SnackbarEvents.emit("You ate some delicious noodles and feel refreshed", "success", 2000);
|
||||
SnackbarEvents.emit("You ate some delicious noodles and feel refreshed", ToastVariant.SUCCESS, 2000);
|
||||
N00dles(); // This is the true power of the noodles.
|
||||
if (Player.sourceFiles.length > 0) Player.giveExploit(Exploit.N00dles);
|
||||
if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) {
|
||||
|
||||
@@ -10,9 +10,7 @@ import { Player } from "../../Player";
|
||||
|
||||
import { Money } from "../../ui/React/Money";
|
||||
|
||||
/**
|
||||
* Attempt to purchase a TOR router using the button.
|
||||
*/
|
||||
/** Attempt to purchase a TOR router using the button. */
|
||||
export function purchaseTorRouter(): void {
|
||||
if (Player.hasTorRouter()) {
|
||||
dialogBoxCreate(`You already have a TOR Router!`);
|
||||
|
||||
Reference in New Issue
Block a user