This commit is contained in:
Olivier Gagnon 2021-08-20 15:45:21 -04:00
parent 980665b77c
commit 567c5dc230
5 changed files with 7 additions and 17 deletions

@ -138,7 +138,7 @@ import {
getStockMarket4SDataCost,
getStockMarket4STixApiCost,
} from "./StockMarket/StockMarketCosts";
import { isValidFilePath } from "./Terminal/DirectoryHelpers";
import { isValidFilePath, removeLeadingSlash } from "./Terminal/DirectoryHelpers";
import { TextFile, getTextFile, createTextFile } from "./TextFile";
import {
@ -172,7 +172,6 @@ import { isString } from "../utils/helpers/isString";
import { createElement } from "../utils/uiHelpers/createElement";
import { createPopup } from "../utils/uiHelpers/createPopup";
import { removeElementById } from "../utils/uiHelpers/removeElementById";
import { removeLeadingSlash } from "./Terminal/DirectoryHelpers";
const defaultInterpreter = new Interpreter('', () => undefined);

@ -60,7 +60,7 @@ export function numCycleForGrowth(server: Server, growth: number, p: IPlayer): n
}
//Applied server growth for a single server. Returns the percentage growth
export function processSingleServerGrowth(server: Server, threads: number, p: IPlayer, cores: number = 1): number {
export function processSingleServerGrowth(server: Server, threads: number, p: IPlayer, cores = 1): number {
let serverGrowth = calculateServerGrowth(server, threads, p, cores);
if (serverGrowth < 1) {
console.warn("serverGrowth calculated to be less than 1");

@ -3,7 +3,7 @@ import { Server } from "../Server";
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
import { IPlayer } from "../../PersonObjects/IPlayer";
export function calculateServerGrowth(server: Server, threads: number, p: IPlayer, cores: number = 1): number {
export function calculateServerGrowth(server: Server, threads: number, p: IPlayer, cores = 1): number {
const numServerGrowthCycles = Math.max(Math.floor(threads), 0);
//Get adjusted growth rate, which accounts for server security

@ -7,7 +7,6 @@ import {
convertTimeMsToTimeElapsedString,
replaceAt,
} from "../utils/StringHelperFunctions";
import { logBoxUpdateText, logBoxOpened } from "../utils/LogBox";
import { Augmentations } from "./Augmentation/Augmentations";
import {
initAugmentations,

@ -3,14 +3,8 @@ import ReactDOM from "react-dom";
import { killWorkerScript } from "../src/Netscript/killWorkerScript";
import { RunningScript } from "../src/Script/RunningScript";
import { clearEventListeners } from "./uiHelpers/clearEventListeners";
import { arrayToString } from "./helpers/arrayToString";
import { createElement } from "./uiHelpers/createElement";
import { removeElementById } from "./uiHelpers/removeElementById";
import Grid from '@material-ui/core/Grid';
import { KEY } from "./helpers/keyCodes";
let gameContainer: HTMLElement;
@ -36,9 +30,8 @@ interface IProps {
function ScriptLogPopup(props: IProps): React.ReactElement {
const setRerender = useState(false)[1];
const [pos, setPos] = useState([0, 0]);
function rerender() {
function rerender(): void {
setRerender(old => !old);
}
@ -78,11 +71,11 @@ function ScriptLogPopup(props: IProps): React.ReactElement {
props.container.style.bottom='';
x=event.clientX;
y=event.clientY;
};
function mouseUp(event: MouseEvent): void {
}
function mouseUp(): void {
document.removeEventListener('mouseup', mouseUp)
document.removeEventListener('mousemove', mouseMove)
};
}
document.addEventListener('mouseup', mouseUp)
document.addEventListener('mousemove', mouseMove)
}
@ -101,7 +94,6 @@ function ScriptLogPopup(props: IProps): React.ReactElement {
</>);
}
let logBoxCurrentScript: RunningScript | null = null;
export function logBoxCreate(script: RunningScript): void {
const id = script.filename+script.args.map((x: any): string => `${x}`).join('');
const container = createElement("div", {