diff --git a/src/Corporation/Corporation.tsx b/src/Corporation/Corporation.tsx index d35b1dd64..f7f3df41c 100644 --- a/src/Corporation/Corporation.tsx +++ b/src/Corporation/Corporation.tsx @@ -34,8 +34,8 @@ interface IParams { name?: string; } -let corpRouting: any; -let companyManagementDiv: any; +let corpRouting: CorporationRouting; +let companyManagementDiv: HTMLDivElement | null = null; export class Corporation { name = "The Corporation"; @@ -379,7 +379,7 @@ export class Corporation { id:"cmpy-mgmt-container", position:"fixed", class:"generic-menupage-container", - }); + }) as HTMLDivElement; const game = document.getElementById("entire-game-container"); if(game) game.appendChild(companyManagementDiv); diff --git a/src/Corporation/IIndustry.ts b/src/Corporation/IIndustry.ts index dd82016d3..298d92fd5 100644 --- a/src/Corporation/IIndustry.ts +++ b/src/Corporation/IIndustry.ts @@ -57,7 +57,7 @@ export interface IIndustry { processProduct(marketCycles: number, product: Product, corporation: ICorporation): number; discontinueProduct(product: Product): void; upgrade(upgrade: IndustryUpgrade, refs: {corporation: ICorporation; office: OfficeSpace}): void; - getOfficeProductivity(office: OfficeSpace, params?: any): number; + getOfficeProductivity(office: OfficeSpace, params?: {forProduct?: boolean}): number; getBusinessFactor(office: OfficeSpace): number; getAdvertisingFactors(): [number, number, number, number]; getMarketFactor(mat: {dmd: number; cmp: number}): number; diff --git a/src/Corporation/Industry.ts b/src/Corporation/Industry.ts index 92d3ff004..49c68203d 100644 --- a/src/Corporation/Industry.ts +++ b/src/Corporation/Industry.ts @@ -1185,7 +1185,7 @@ export class Industry implements IIndustry { } // Returns how much of a material can be produced based of office productivity (employee stats) - getOfficeProductivity(office: OfficeSpace, params: any = {}): number { + getOfficeProductivity(office: OfficeSpace, params: {forProduct?: boolean} = {}): number { const opProd = office.employeeProd[EmployeePositions.Operations]; const engrProd = office.employeeProd[EmployeePositions.Engineer]; const mgmtProd = office.employeeProd[EmployeePositions.Management] diff --git a/src/Corporation/OfficeSpace.ts b/src/Corporation/OfficeSpace.ts index ed3655f50..4a419ffea 100644 --- a/src/Corporation/OfficeSpace.ts +++ b/src/Corporation/OfficeSpace.ts @@ -38,7 +38,7 @@ export class OfficeSpace { minHap = 0; maxHap = 100; maxMor = 100; - employees: any[] = []; + employees: Employee[] = []; employeeProd: {[key: string]: number} = { [EmployeePositions.Operations]: 0, [EmployeePositions.Engineer]: 0, @@ -186,7 +186,7 @@ export class OfficeSpace { innerHTML: "Select one of the following candidates for hire:", }); - function createEmpDiv(employee: any, office: any): HTMLElement { + function createEmpDiv(employee: Employee, office: OfficeSpace): HTMLElement { const div = createElement("div", { class:"cmpy-mgmt-find-employee-option", innerHTML: "Intelligence: " + formatNumber(employee.int, 1) + "
" + diff --git a/src/Corporation/ui/ThrowPartyPopup.tsx b/src/Corporation/ui/ThrowPartyPopup.tsx index 0b18186c7..6f6fc774d 100644 --- a/src/Corporation/ui/ThrowPartyPopup.tsx +++ b/src/Corporation/ui/ThrowPartyPopup.tsx @@ -27,9 +27,9 @@ export function ThrowPartyPopup(props: IProps): React.ReactElement { dialogBoxCreate("You don't have enough company funds to throw a party!"); } else { props.corp.funds = props.corp.funds.minus(totalCost); - let mult; - for (let fooit = 0; fooit < props.office.employees.length; ++fooit) { - mult = props.office.employees[fooit].throwParty(cost); + let mult = 0; + for (let i = 0; i < props.office.employees.length; ++i) { + mult = props.office.employees[i].throwParty(cost); } dialogBoxCreate("You threw a party for the office! The morale and happiness " + "of each employee increased by " + numeralWrapper.formatPercentage((mult-1)));