No more player/router context

This commit is contained in:
Snarling
2022-09-12 18:00:09 -04:00
parent 83d357e758
commit a21b1029d7
56 changed files with 418 additions and 527 deletions

View File

@@ -6,7 +6,7 @@ import * as React from "react";
import { Money } from "../React/Money";
import { MoneyRate } from "../React/MoneyRate";
import { use } from "../Context";
import { Player } from "../../Player";
import Typography from "@mui/material/Typography";
@@ -32,9 +32,8 @@ const useStyles = makeStyles((theme: Theme) =>
}),
);
export function ScriptProduction(): React.ReactElement {
const player = use.Player();
const classes = useStyles();
const prodRateSinceLastAug = player.scriptProdSinceLastAug / (player.playtimeSinceLastAug / 1000);
const prodRateSinceLastAug = Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug / 1000);
return (
<Table size="small" classes={{ root: classes.size }}>
@@ -45,7 +44,7 @@ export function ScriptProduction(): React.ReactElement {
</TableCell>
<TableCell align="left" classes={{ root: classes.cell }}>
<Typography variant="body2">
<Money money={player.scriptProdSinceLastAug} />
<Money money={Player.scriptProdSinceLastAug} />
</Typography>
</TableCell>
<TableCell align="left" classes={{ root: classes.cell }}>