From ab56d18e1ee82e49185027c00224b5e5a64bd4af Mon Sep 17 00:00:00 2001 From: Snarling <84951833+Snarling@users.noreply.github.com> Date: Sat, 1 Oct 2022 15:49:23 -0400 Subject: [PATCH] group initializers --- src/SourceFile/SourceFiles.tsx | 4 +++- src/engine.tsx | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/SourceFile/SourceFiles.tsx b/src/SourceFile/SourceFiles.tsx index 72d140f5a..8d8f23818 100644 --- a/src/SourceFile/SourceFiles.tsx +++ b/src/SourceFile/SourceFiles.tsx @@ -1,11 +1,13 @@ import React from "react"; import { SourceFile } from "./SourceFile"; import { IMap } from "../types"; -import { initBitNodes } from "../BitNode/BitNode"; +import { initBitNodes, initBitNodeMultipliers } from "../BitNode/BitNode"; export const SourceFiles: IMap = {}; +/** Engine initializer for SourceFiles, BitNodes, and BitNodeMultipliers. Run once at engine load. */ export function initSourceFiles() { initBitNodes(); + initBitNodeMultipliers(); SourceFiles["SourceFile1"] = new SourceFile( 1, ( diff --git a/src/engine.tsx b/src/engine.tsx index ef3374821..78f3d7bb5 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -4,7 +4,6 @@ import { convertTimeMsToTimeElapsedString } from "./utils/StringHelperFunctions"; import { initAugmentations } from "./Augmentation/AugmentationHelpers"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; -import { initBitNodeMultipliers } from "./BitNode/BitNode"; import { initSourceFiles } from "./SourceFile/SourceFiles"; import { initDarkWebItems } from "./DarkWeb/DarkWebItems"; import { generateRandomContract } from "./CodingContractGenerator"; @@ -232,7 +231,6 @@ const Engine: { if (loadGame(saveString)) { ThemeEvents.emit(); initSourceFiles(); - initBitNodeMultipliers(); initDarkWebItems(); initAugmentations(); // Also calls Player.reapplyAllAugmentations() Player.reapplyAllSourceFiles(); @@ -372,7 +370,6 @@ const Engine: { } else { // No save found, start new game initSourceFiles(); - initBitNodeMultipliers(); initDarkWebItems(); Engine.start(); // Run main game loop and Scripts loop Player.init();