CODEBASE: Add Jsonable Map and Set types, move player.sourceFiles to a map (#473)

This commit is contained in:
Snarling
2023-04-18 03:19:45 -04:00
committed by GitHub
parent c44bdc1018
commit 0df984eea0
55 changed files with 439 additions and 532 deletions
+3 -3
View File
@@ -84,7 +84,7 @@ function MultiplierTable(props: MultTableProps): React.ReactElement {
}
function CurrentBitNode(): React.ReactElement {
if (Player.sourceFiles.length > 0) {
if (Player.sourceFiles.size > 0) {
const index = "BitNode" + Player.bitNodeN;
const lvl = Math.min(Player.sourceFileLvl(Player.bitNodeN) + 1, Player.bitNodeN === 12 ? Infinity : 3);
return (
@@ -175,7 +175,7 @@ function MoneyModal({ open, onClose }: IMoneyModalProps): React.ReactElement {
{convertMoneySourceTrackerToString(Player.moneySourceA)}
</>
);
if (Player.sourceFiles.length !== 0) {
if (Player.sourceFiles.size > 0) {
content = (
<>
{content}
@@ -205,7 +205,7 @@ export function CharacterStats(): React.ReactElement {
const timeRows = [
["Since last Augmentation installation", convertTimeMsToTimeElapsedString(Player.playtimeSinceLastAug)],
];
if (Player.sourceFiles.length > 0) {
if (Player.sourceFiles.size > 0) {
timeRows.push(["Since last Bitnode destroyed", convertTimeMsToTimeElapsedString(Player.playtimeSinceLastBitnode)]);
}
timeRows.push(["Total", convertTimeMsToTimeElapsedString(Player.totalPlaytime)]);