TYPESAFETY: CompanyName (#650)

This commit is contained in:
Snarling
2023-07-11 09:23:17 -04:00
committed by GitHub
parent e4d3a9020e
commit e2655793f4
40 changed files with 1548 additions and 1516 deletions
+6 -2
View File
@@ -2,6 +2,8 @@ import React from "react";
import { Typography, Table, TableBody, TableCell, TableRow } from "@mui/material";
import { Player } from "@player";
import { CONSTANTS } from "../../../Constants";
import {
@@ -141,8 +143,10 @@ export function EarningsElement(props: IProps): React.ReactElement {
];
}
if (isSleeveCompanyWork(props.sleeve.currentWork)) {
const rates = props.sleeve.currentWork.getGainRates(props.sleeve);
companyWork: if (isSleeveCompanyWork(props.sleeve.currentWork)) {
const job = Player.jobs[props.sleeve.currentWork.companyName];
if (!job) break companyWork;
const rates = props.sleeve.currentWork.getGainRates(props.sleeve, job);
data = [
[`Money:`, <MoneyRate key="money-rate" money={CYCLES_PER_SEC * rates.money} />],
[`Hacking Exp:`, `${formatExp(CYCLES_PER_SEC * rates.hackExp)} / sec`],