From a2379b21ec68a5dd3ebb4916d419c2169dff8b31 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Tue, 31 Aug 2021 03:39:04 -0400 Subject: [PATCH] more conversion --- src/Corporation/Employee.ts | 5 ++- src/Corporation/Industry.ts | 31 ++++++------- src/Corporation/ui/BribeFactionPopup.tsx | 5 ++- src/Corporation/ui/BuybackSharesPopup.tsx | 7 +-- .../ui/DiscontinueProductPopup.tsx | 7 ++- src/Corporation/ui/ExpandNewCityPopup.tsx | 3 +- src/Corporation/ui/ExportPopup.tsx | 3 +- src/Corporation/ui/FindInvestorsPopup.tsx | 7 ++- src/Corporation/ui/GoPublicPopup.tsx | 7 ++- src/Corporation/ui/Industry.tsx | 7 ++- src/Corporation/ui/IndustryOffice.tsx | 44 ++++++++++--------- src/Corporation/ui/IndustryOverview.tsx | 7 ++- src/Corporation/ui/IndustryWarehouse.tsx | 14 ++++-- src/Corporation/ui/IssueDividendsPopup.tsx | 3 +- src/Corporation/ui/IssueNewSharesPopup.tsx | 3 +- src/Corporation/ui/LevelableUpgrade.tsx | 10 +++-- src/Corporation/ui/MakeProductPopup.tsx | 3 +- src/Corporation/ui/NewIndustryPopup.tsx | 3 +- src/Corporation/ui/Overview.tsx | 4 ++ src/Corporation/ui/SellMaterialPopup.tsx | 3 +- src/Corporation/ui/SellSharesPopup.tsx | 7 +-- src/Corporation/ui/ThrowPartyPopup.tsx | 3 +- src/Corporation/ui/UnlockUpgrade.tsx | 7 ++- src/Corporation/ui/UpgradeOfficeSizePopup.tsx | 7 ++- 24 files changed, 127 insertions(+), 73 deletions(-) diff --git a/src/Corporation/Employee.ts b/src/Corporation/Employee.ts index b69aae632..d5053ff24 100644 --- a/src/Corporation/Employee.ts +++ b/src/Corporation/Employee.ts @@ -3,6 +3,7 @@ import { getRandomInt } from "../../utils/helpers/getRandomInt"; import { Generic_fromJSON, Generic_toJSON, Reviver } from "../../utils/JSONReviver"; import { createElement } from "../../utils/uiHelpers/createElement"; import { EmployeePositions } from "./EmployeePositions"; +import { ICorporation } from "./ICorporation"; import { numeralWrapper } from "../ui/numeralFormat"; import { formatNumber } from "../../utils/StringHelperFunctions"; @@ -86,7 +87,7 @@ export class Employee { return salary; } - calculateProductivity(corporation: any, industry: any): number { + calculateProductivity(corporation: ICorporation, industry: any): number { const effCre = this.cre * corporation.getEmployeeCreMultiplier() * industry.getEmployeeCreMultiplier(), effCha = this.cha * corporation.getEmployeeChaMultiplier() * industry.getEmployeeChaMultiplier(), effInt = this.int * corporation.getEmployeeIntMultiplier() * industry.getEmployeeIntMultiplier(), @@ -137,7 +138,7 @@ export class Employee { } //'panel' is the DOM element on which to create the UI - createUI(panel: any, corporation: any, industry: any): void { + createUI(panel: any, corporation: ICorporation, industry: any): void { const effCre = this.cre * corporation.getEmployeeCreMultiplier() * industry.getEmployeeCreMultiplier(), effCha = this.cha * corporation.getEmployeeChaMultiplier() * industry.getEmployeeChaMultiplier(), effInt = this.int * corporation.getEmployeeIntMultiplier() * industry.getEmployeeIntMultiplier(), diff --git a/src/Corporation/Industry.ts b/src/Corporation/Industry.ts index ebdb96835..18e3dbd11 100644 --- a/src/Corporation/Industry.ts +++ b/src/Corporation/Industry.ts @@ -19,6 +19,7 @@ import { dialogBoxCreate } from "../../utils/DialogBox"; import { isString } from "../../utils/helpers/isString"; import { MaterialSizes } from "./MaterialSizes"; import { Warehouse } from "./Warehouse"; +import { ICorporation } from "./ICorporation"; import { IndustryUpgrade, IndustryUpgrades } from "./IndustryUpgrades"; @@ -401,7 +402,7 @@ export class Industry { } } - process(marketCycles=1, state: string, company: any): void { + process(marketCycles=1, state: string, corporation: ICorporation): void { this.state = state; //At the start of a cycle, store and reset revenue/expenses @@ -426,7 +427,7 @@ export class Industry { let employeeSalary = 0; for (const officeLoc in this.offices) { if (this.offices[officeLoc] instanceof OfficeSpace) { - employeeSalary += this.offices[officeLoc].process(marketCycles, {industry:this, corporation:company}); + employeeSalary += this.offices[officeLoc].process(marketCycles, {industry:this, corporation:corporation}); } } this.thisCycleExpenses = this.thisCycleExpenses.plus(employeeSalary); @@ -440,7 +441,7 @@ export class Industry { this.popularity = Math.max(0, this.popularity); // Process Dreamsense gains - const popularityGain = company.getDreamSenseGain(), awarenessGain = popularityGain * 4; + const popularityGain = corporation.getDreamSenseGain(), awarenessGain = popularityGain * 4; if (popularityGain > 0) { this.popularity += (popularityGain * marketCycles); this.awareness += (awarenessGain * marketCycles); @@ -450,14 +451,14 @@ export class Industry { } // Process production, purchase, and import/export of materials - let res = this.processMaterials(marketCycles, company); + let res = this.processMaterials(marketCycles, corporation); if (Array.isArray(res)) { this.thisCycleRevenue = this.thisCycleRevenue.plus(res[0]); this.thisCycleExpenses = this.thisCycleExpenses.plus(res[1]); } // Process creation, production & sale of products - res = this.processProducts(marketCycles, company); + res = this.processProducts(marketCycles, corporation); if (Array.isArray(res)) { this.thisCycleRevenue = this.thisCycleRevenue.plus(res[0]); this.thisCycleExpenses = this.thisCycleExpenses.plus(res[1]); @@ -518,7 +519,7 @@ export class Industry { } //Process production, purchase, and import/export of materials - processMaterials(marketCycles=1, company: any): [number, number] { + processMaterials(marketCycles=1, corporation: ICorporation): [number, number] { let revenue = 0, expenses = 0; this.calculateProductionFactors(); @@ -588,7 +589,7 @@ export class Industry { //on the office's productivity const maxProd = this.getOfficeProductivity(office) * this.prodMult // Multiplier from materials - * company.getProductionMultiplier() + * corporation.getProductionMultiplier() * this.getProductionMultiplier(); // Multiplier from Research let prod; @@ -700,7 +701,7 @@ export class Industry { const sqrtDenominator = ((mat.qlt + .001) * marketFactor * businessFactor - * company.getSalesMultiplier() + * corporation.getSalesMultiplier() * advertisingFactor * this.getSalesMultiplier()); const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator); @@ -750,7 +751,7 @@ export class Industry { * marketFactor * markup * businessFactor - * company.getSalesMultiplier() + * corporation.getSalesMultiplier() * advertisingFactor * this.getSalesMultiplier(); let sellAmt; @@ -822,9 +823,9 @@ export class Industry { if (amt === 0) { break; //None left } - for (let foo = 0; foo < company.divisions.length; ++foo) { - if (company.divisions[foo].name === exp.ind) { - const expIndustry = company.divisions[foo]; + for (let foo = 0; foo < corporation.divisions.length; ++foo) { + if (corporation.divisions[foo].name === exp.ind) { + const expIndustry = corporation.divisions[foo]; const expWarehouse = expIndustry.warehouses[exp.city]; if (!(expWarehouse instanceof Warehouse)) { console.error(`Invalid export! ${expIndustry.name} ${exp.city}`); @@ -872,7 +873,7 @@ export class Industry { if (office instanceof OfficeSpace) { this.sciResearch.qty += (.004 * Math.pow(office.employeeProd[EmployeePositions.RandD], 0.5) - * company.getScientificResearchMultiplier() + * corporation.getScientificResearchMultiplier() * this.getScientificResearchMultiplier()); } } @@ -880,7 +881,7 @@ export class Industry { } //Process production & sale of this industry's FINISHED products (including all of their stats) - processProducts(marketCycles=1, corporation: any): [number, number] { + processProducts(marketCycles=1, corporation: ICorporation): [number, number] { let revenue = 0; const expenses = 0; @@ -926,7 +927,7 @@ export class Industry { } //Processes FINISHED products - processProduct(marketCycles=1, product: Product, corporation: any): number { + processProduct(marketCycles=1, product: Product, corporation: ICorporation): number { let totalProfit = 0; for (let i = 0; i < CorporationConstants.Cities.length; ++i) { const city = CorporationConstants.Cities[i], office = this.offices[city], warehouse = this.warehouses[city]; diff --git a/src/Corporation/ui/BribeFactionPopup.tsx b/src/Corporation/ui/BribeFactionPopup.tsx index e50ebfb11..3ded57c1c 100644 --- a/src/Corporation/ui/BribeFactionPopup.tsx +++ b/src/Corporation/ui/BribeFactionPopup.tsx @@ -5,10 +5,11 @@ import { CorporationConstants } from "../data/Constants"; import { numeralWrapper } from "../../ui/numeralFormat"; import { removePopup } from "../../ui/React/createPopup"; import { dialogBoxCreate } from "../../../utils/DialogBox"; +import { ICorporation } from "../ICorporation"; interface IProps { popupId: string; - corp: any; + corp: ICorporation; player: IPlayer; } @@ -39,7 +40,7 @@ export function BribeFactionPopup(props: IProps): React.ReactElement { return "ERROR: Invalid value(s) entered"; } else if (props.corp.funds.lt(money)) { return "ERROR: You do not have this much money to bribe with"; - } else if (props.corp.stock > props.corp.numShares) { + } else if (stock > props.corp.numShares) { return "ERROR: You do not have this many shares to bribe with"; } else { return "You will gain " + numeralWrapper.formatReputation(repGain(money, stock)) + diff --git a/src/Corporation/ui/BuybackSharesPopup.tsx b/src/Corporation/ui/BuybackSharesPopup.tsx index 6b45d87ac..eda57a330 100644 --- a/src/Corporation/ui/BuybackSharesPopup.tsx +++ b/src/Corporation/ui/BuybackSharesPopup.tsx @@ -3,11 +3,12 @@ import { IPlayer } from "../../PersonObjects/IPlayer"; import { removePopup } from "../../ui/React/createPopup"; import { numeralWrapper } from "../../ui/numeralFormat"; import { dialogBoxCreate } from "../../../utils/DialogBox"; +import { ICorporation } from "../ICorporation"; interface IProps { player: IPlayer; popupId: string; - corp: any; + corp: ICorporation; } // Create a popup that lets the player buyback shares @@ -39,7 +40,7 @@ export function BuybackSharesPopup(props: IProps): React.ReactElement { if (isNaN(props.corp.issuedShares)) { console.warn("Corporation issuedShares is NaN: " + props.corp.issuedShares); console.warn("Converting to number now"); - const res = parseInt(props.corp.issuedShares); + const res = props.corp.issuedShares; if (isNaN(res)) { props.corp.issuedShares = 0; } else { @@ -49,7 +50,7 @@ export function BuybackSharesPopup(props: IProps): React.ReactElement { props.corp.issuedShares -= shares; props.player.loseMoney(shares * buybackPrice); removePopup(props.popupId); - props.corp.rerender(); + props.corp.rerender(props.player); } } diff --git a/src/Corporation/ui/DiscontinueProductPopup.tsx b/src/Corporation/ui/DiscontinueProductPopup.tsx index d22b139f3..bc81a7567 100644 --- a/src/Corporation/ui/DiscontinueProductPopup.tsx +++ b/src/Corporation/ui/DiscontinueProductPopup.tsx @@ -1,11 +1,14 @@ import React from 'react'; import { removePopup } from "../../ui/React/createPopup"; +import { ICorporation } from "../ICorporation"; +import { IPlayer } from "../../PersonObjects/IPlayer"; interface IProps { product: any; industry: any; - corp: any; + corp: ICorporation; popupId: string; + player: IPlayer; } // Create a popup that lets the player discontinue a product @@ -13,7 +16,7 @@ export function DiscontinueProductPopup(props: IProps): React.ReactElement { function discontinue(): void { props.industry.discontinueProduct(props.product); removePopup(props.popupId); - props.corp.rerender(); + props.corp.rerender(props.player); } return (<> diff --git a/src/Corporation/ui/ExpandNewCityPopup.tsx b/src/Corporation/ui/ExpandNewCityPopup.tsx index c9d91087f..ba02f6c81 100644 --- a/src/Corporation/ui/ExpandNewCityPopup.tsx +++ b/src/Corporation/ui/ExpandNewCityPopup.tsx @@ -5,10 +5,11 @@ import { CorporationConstants } from "../data/Constants"; import { removePopup } from "../../ui/React/createPopup"; import { dialogBoxCreate } from "../../../utils/DialogBox"; import { OfficeSpace } from "../OfficeSpace"; +import { ICorporation } from "../ICorporation"; interface IProps { popupId: string; - corp: any; + corp: ICorporation; division: IDivision; cityStateSetter: (city: string) => void; } diff --git a/src/Corporation/ui/ExportPopup.tsx b/src/Corporation/ui/ExportPopup.tsx index d4fe7bca7..39e5936be 100644 --- a/src/Corporation/ui/ExportPopup.tsx +++ b/src/Corporation/ui/ExportPopup.tsx @@ -1,10 +1,11 @@ import React, { useState } from 'react'; import { dialogBoxCreate } from "../../../utils/DialogBox"; import { removePopup } from "../../ui/React/createPopup"; +import { ICorporation } from "../ICorporation"; interface IProps { mat: any; - corp: any; + corp: ICorporation; popupId: string; } diff --git a/src/Corporation/ui/FindInvestorsPopup.tsx b/src/Corporation/ui/FindInvestorsPopup.tsx index ee10eb87b..3c52331ba 100644 --- a/src/Corporation/ui/FindInvestorsPopup.tsx +++ b/src/Corporation/ui/FindInvestorsPopup.tsx @@ -2,10 +2,13 @@ import React from 'react'; import { removePopup } from "../../ui/React/createPopup"; import { numeralWrapper } from "../../ui/numeralFormat"; import { CorporationConstants } from "../data/Constants"; +import { ICorporation } from "../ICorporation"; +import { IPlayer } from "../../PersonObjects/IPlayer"; interface IProps { - corp: any; + corp: ICorporation; popupId: string; + player: IPlayer; } // Create a popup that lets the player manage exports @@ -40,7 +43,7 @@ export function FindInvestorsPopup(props: IProps): React.ReactElement { props.corp.fundingRound++; props.corp.addFunds(funding); props.corp.numShares -= investShares; - props.corp.rerender(); + props.corp.rerender(props.player); removePopup(props.popupId); } return (<> diff --git a/src/Corporation/ui/GoPublicPopup.tsx b/src/Corporation/ui/GoPublicPopup.tsx index 60f874d80..305c502d4 100644 --- a/src/Corporation/ui/GoPublicPopup.tsx +++ b/src/Corporation/ui/GoPublicPopup.tsx @@ -2,10 +2,13 @@ import React, { useState } from 'react'; import { dialogBoxCreate } from "../../../utils/DialogBox"; import { removePopup } from "../../ui/React/createPopup"; import { numeralWrapper } from "../../ui/numeralFormat"; +import { ICorporation } from "../ICorporation"; +import { IPlayer } from "../../PersonObjects/IPlayer"; interface IProps { - corp: any; + corp: ICorporation; popupId: string; + player: IPlayer; } // Create a popup that lets the player manage exports @@ -29,7 +32,7 @@ export function GoPublicPopup(props: IProps): React.ReactElement { props.corp.issuedShares = numShares; props.corp.numShares -= numShares; props.corp.addFunds(numShares * initialSharePrice); - props.corp.rerender(); + props.corp.rerender(props.player); dialogBoxCreate(`You took your ${props.corp.name} public and earned ` + `${numeralWrapper.formatMoney(numShares * initialSharePrice)} in your IPO`); removePopup(props.popupId); diff --git a/src/Corporation/ui/Industry.tsx b/src/Corporation/ui/Industry.tsx index 5254c3676..c96596212 100644 --- a/src/Corporation/ui/Industry.tsx +++ b/src/Corporation/ui/Industry.tsx @@ -7,11 +7,13 @@ import { IndustryOverview } from "./IndustryOverview"; import { IndustryWarehouse } from "./IndustryWarehouse"; import { ICorporation } from "../ICorporation"; import { CorporationRouting } from "./Routing"; +import { IPlayer } from "../../PersonObjects/IPlayer"; interface IProps { routing: CorporationRouting; corp: ICorporation; currentCity: string; + player: IPlayer; } export function Industry(props: IProps): React.ReactElement { @@ -19,16 +21,19 @@ export function Industry(props: IProps): React.ReactElement {
-
diff --git a/src/Corporation/ui/IndustryOffice.tsx b/src/Corporation/ui/IndustryOffice.tsx index a88fb883e..ac6e701b3 100644 --- a/src/Corporation/ui/IndustryOffice.tsx +++ b/src/Corporation/ui/IndustryOffice.tsx @@ -12,11 +12,14 @@ import { getSelectText } from "../../../utils/uiHelpers/getSelectData import { createPopup } from "../../ui/React/createPopup"; import { UpgradeOfficeSizePopup } from "./UpgradeOfficeSizePopup"; import { ThrowPartyPopup } from "./ThrowPartyPopup"; +import { ICorporation } from "../ICorporation"; +import { IPlayer } from "../../PersonObjects/IPlayer"; interface IProps { routing: any; - corp: any; + corp: ICorporation; currentCity: string; + player: IPlayer; } export function IndustryOffice(props: IProps): React.ReactElement { @@ -132,7 +135,7 @@ export function IndustryOffice(props: IProps): React.ReactElement { function switchModeOnClick(): void { setEmployeeManualAssignMode(true); - props.corp.rerender(); + props.corp.rerender(props.player); } // Calculate average morale, happiness, and energy. Also salary @@ -189,7 +192,7 @@ export function IndustryOffice(props: IProps): React.ReactElement { office.assignEmployeeToJob(to); office.calculateEmployeeProductivity({ corporation: props.corp, industry:division }); - props.corp.rerender(); + props.corp.rerender(props.player); } function unassignEmployee(from: string): void { @@ -233,7 +236,7 @@ export function IndustryOffice(props: IProps): React.ReactElement { office.unassignEmployeeFromJob(from); office.calculateEmployeeProductivity({ corporation: props.corp, industry:division }); - props.corp.rerender(); + props.corp.rerender(props.player); } const positionHeaderStyle = { @@ -245,61 +248,61 @@ export function IndustryOffice(props: IProps): React.ReactElement { function operationAssignButtonOnClick(): void { assignEmployee(EmployeePositions.Operations); - props.corp.rerender(); + props.corp.rerender(props.player); } function operationUnassignButtonOnClick(): void { unassignEmployee(EmployeePositions.Operations); - props.corp.rerender(); + props.corp.rerender(props.player); } const operationUnassignButtonClass = numOperations > 0 ? "std-button" : "a-link-button-inactive"; function engineerAssignButtonOnClick(): void { assignEmployee(EmployeePositions.Engineer); - props.corp.rerender(); + props.corp.rerender(props.player); } function engineerUnassignButtonOnClick(): void { unassignEmployee(EmployeePositions.Engineer); - props.corp.rerender(); + props.corp.rerender(props.player); } const engineerUnassignButtonClass = numEngineers > 0 ? "std-button" : "a-link-button-inactive"; function businessAssignButtonOnClick(): void { assignEmployee(EmployeePositions.Business); - props.corp.rerender(); + props.corp.rerender(props.player); } function businessUnassignButtonOnClick(): void { unassignEmployee(EmployeePositions.Business); - props.corp.rerender(); + props.corp.rerender(props.player); } const businessUnassignButtonClass = numBusiness > 0 ? "std-button" : "a-link-button-inactive"; function managementAssignButtonOnClick(): void { assignEmployee(EmployeePositions.Management); - props.corp.rerender(); + props.corp.rerender(props.player); } function managementUnassignButtonOnClick(): void { unassignEmployee(EmployeePositions.Management); - props.corp.rerender(); + props.corp.rerender(props.player); } const managementUnassignButtonClass = numManagement > 0 ? "std-button" : "a-link-button-inactive"; function rndAssignButtonOnClick(): void { assignEmployee(EmployeePositions.RandD); - props.corp.rerender(); + props.corp.rerender(props.player); } function rndUnassignButtonOnClick(): void { unassignEmployee(EmployeePositions.RandD); - props.corp.rerender(); + props.corp.rerender(props.player); } const rndUnassignButtonClass = numResearch > 0 ? "std-button" : "a-link-button-inactive"; function trainingAssignButtonOnClick(): void { assignEmployee(EmployeePositions.Training); - props.corp.rerender(); + props.corp.rerender(props.player); } function trainingUnassignButtonOnClick(): void { unassignEmployee(EmployeePositions.Training); - props.corp.rerender(); + props.corp.rerender(props.player); } const trainingUnassignButtonClass = numTraining > 0 ? "std-button" : "a-link-button-inactive"; @@ -433,7 +436,7 @@ export function IndustryOffice(props: IProps): React.ReactElement { function switchModeOnClick(): void { setEmployeeManualAssignMode(false); - props.corp.rerender(); + props.corp.rerender(props.player); } const employeeInfoDivStyle = { @@ -457,7 +460,7 @@ export function IndustryOffice(props: IProps): React.ReactElement { } } - corp.rerender(); + corp.rerender(props.player); } // Employee Positions Selector @@ -477,7 +480,7 @@ export function IndustryOffice(props: IProps): React.ReactElement { const pos = getSelectText(e.target); employee.pos = pos; resetEmployeeCount(); - corp.rerender(); + corp.rerender(props.player); } // Numeraljs formatter @@ -570,7 +573,7 @@ export function IndustryOffice(props: IProps): React.ReactElement { function autohireEmployeeButtonOnClick(): void { if (office.atCapacity()) return; office.hireRandomEmployee(); - props.corp.rerender(); + props.corp.rerender(props.player); } function openUpgradeOfficeSizePopup(): void { @@ -579,6 +582,7 @@ export function IndustryOffice(props: IProps): React.ReactElement { office: office, corp: props.corp, popupId: popupId, + player: props.player, }); } diff --git a/src/Corporation/ui/IndustryOverview.tsx b/src/Corporation/ui/IndustryOverview.tsx index a8389514d..2f7ed490e 100644 --- a/src/Corporation/ui/IndustryOverview.tsx +++ b/src/Corporation/ui/IndustryOverview.tsx @@ -11,11 +11,14 @@ import { createProgressBarText } from "../../../utils/helpers/createProgressB import { MakeProductPopup } from "./MakeProductPopup"; import { ResearchPopup } from "./ResearchPopup"; import { createPopup } from "../../ui/React/createPopup"; +import { ICorporation } from "../ICorporation"; +import { IPlayer } from "../../PersonObjects/IPlayer"; interface IProps { routing: any; - corp: any; + corp: ICorporation; currentCity: string; + player: IPlayer; } export function IndustryOverview(props: IProps): React.ReactElement { @@ -249,7 +252,7 @@ export function IndustryOverview(props: IProps): React.ReactElement { office: office, }); // corp.displayDivisionContent(division, city); - corp.rerender(); + corp.rerender(props.player); } } diff --git a/src/Corporation/ui/IndustryWarehouse.tsx b/src/Corporation/ui/IndustryWarehouse.tsx index 2d8526ddb..f47cf6811 100644 --- a/src/Corporation/ui/IndustryWarehouse.tsx +++ b/src/Corporation/ui/IndustryWarehouse.tsx @@ -21,12 +21,15 @@ import { dialogBoxCreate } from "../../../utils/DialogBox"; import { createPopup } from "../../ui/React/createPopup"; import { isString } from "../../../utils/helpers/isString"; +import { ICorporation } from "../ICorporation"; +import { IPlayer } from "../../PersonObjects/IPlayer"; interface IProductProps { - corp: any; + corp: ICorporation; division: any; city: string; product: any; + player: IPlayer; } // Creates the UI for a single Product type @@ -101,6 +104,7 @@ function ProductComponent(props: IProductProps): React.ReactElement { industry: division, corp: props.corp, popupId: popupId, + player: props.player, }); } @@ -404,6 +408,7 @@ interface IProps { corp: any; routing: any; currentCity: string; + player: IPlayer; } export function IndustryWarehouse(props: IProps): React.ReactElement { @@ -439,7 +444,7 @@ export function IndustryWarehouse(props: IProps): React.ReactElement { ++warehouse.level; warehouse.updateSize(corp, division); corp.funds = corp.funds.minus(sizeUpgradeCost); - corp.rerender(); + corp.rerender(props.player); } // Industry material Requirements @@ -503,7 +508,7 @@ export function IndustryWarehouse(props: IProps): React.ReactElement { const smartSupplyCheckboxId = "cmpy-mgmt-smart-supply-checkbox"; function smartSupplyOnChange(e: React.ChangeEvent): void { warehouse.smartSupplyEnabled = e.target.checked; - corp.rerender(); + corp.rerender(props.player); } // Create React components for materials @@ -529,6 +534,7 @@ export function IndustryWarehouse(props: IProps): React.ReactElement { for (const productName in division.products) { if (division.products[productName] instanceof Product) { products.push( { if (props.corp.unlockUpgrades[unlockData[0]] === 0) { unlockUpgrades.push( Upgrades { levelableUpgradeProps.map((data: any) =>