-
+
void;
}
function countEmployee(employees: Employee[], job: string): number {
@@ -87,7 +88,7 @@ function ManualManagement(props: IProps): React.ReactElement {
}
}
- props.corp.rerender(props.player);
+ props.rerender();
}
// Employee Positions Selector
@@ -110,7 +111,7 @@ function ManualManagement(props: IProps): React.ReactElement {
if (employee === null) return;
const pos = getSelectText(e.target);
employee.pos = pos;
- props.corp.rerender(props.player);
+ props.rerender();
}
// Numeraljs formatter
@@ -168,6 +169,7 @@ interface IAutoAssignProps {
player: IPlayer;
job: string;
desc: string;
+ rerender: () => void;
}
function AutoAssignJob(props: IAutoAssignProps): React.ReactElement {
@@ -181,13 +183,13 @@ function AutoAssignJob(props: IAutoAssignProps): React.ReactElement {
props.office.assignEmployeeToJob(props.job);
props.office.calculateEmployeeProductivity(props.corp, props.division);
- props.corp.rerender(props.player);
+ props.rerender();
}
function unassignEmployee(): void {
props.office.unassignEmployeeFromJob(props.job);
props.office.calculateEmployeeProductivity(props.corp, props.division);
- props.corp.rerender(props.player);
+ props.rerender();
}
const positionHeaderStyle = {
fontSize: "15px",
@@ -335,6 +337,7 @@ function AutoManagement(props: IProps): React.ReactElement {
{employeeManualAssignMode ? (
-
+
) : (
-
+
)}
);
diff --git a/src/Corporation/ui/IndustryOverview.tsx b/src/Corporation/ui/IndustryOverview.tsx
index 4d2177873..34ea97d6a 100644
--- a/src/Corporation/ui/IndustryOverview.tsx
+++ b/src/Corporation/ui/IndustryOverview.tsx
@@ -23,6 +23,7 @@ interface IProps {
division: IIndustry;
office: OfficeSpace;
player: IPlayer;
+ rerender: () => void;
}
export function IndustryOverview(props: IProps): React.ReactElement {
@@ -281,8 +282,7 @@ export function IndustryOverview(props: IProps): React.ReactElement {
corporation: props.corp,
office: props.office,
});
- // corp.displayDivisionContent(division, city);
- props.corp.rerender(props.player);
+ props.rerender();
}
upgrades.push(
diff --git a/src/Corporation/ui/IndustryWarehouse.tsx b/src/Corporation/ui/IndustryWarehouse.tsx
index 16ace3247..55181ebdb 100644
--- a/src/Corporation/ui/IndustryWarehouse.tsx
+++ b/src/Corporation/ui/IndustryWarehouse.tsx
@@ -36,6 +36,7 @@ interface IProductProps {
city: string;
product: Product;
player: IPlayer;
+ rerender: () => void;
}
// Creates the UI for a single Product type
@@ -132,6 +133,7 @@ function ProductComponent(props: IProductProps): React.ReactElement {
function openDiscontinueProductPopup(): void {
const popupId = "cmpy-mgmt-discontinue-product-popup";
createPopup(popupId, DiscontinueProductPopup, {
+ rerender: props.rerender,
product: product,
industry: division,
corp: props.corp,
@@ -251,6 +253,7 @@ interface IMaterialProps {
warehouse: Warehouse;
city: string;
mat: Material;
+ rerender: () => void;
}
// Creates the UI for a single Material type
@@ -444,6 +447,7 @@ interface IProps {
warehouse: Warehouse | 0;
currentCity: string;
player: IPlayer;
+ rerender: () => void;
}
export function IndustryWarehouse(props: IProps): React.ReactElement {
@@ -465,7 +469,7 @@ export function IndustryWarehouse(props: IProps): React.ReactElement {
++props.warehouse.level;
props.warehouse.updateSize(props.corp, props.division);
props.corp.funds = props.corp.funds.minus(sizeUpgradeCost);
- props.corp.rerender(props.player);
+ props.rerender();
}
function openSmartSupplyPopup(): void {
@@ -523,6 +527,7 @@ export function IndustryWarehouse(props: IProps): React.ReactElement {
if (isRelevantMaterial(matName, props.division)) {
mats.push(