mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-02-18 10:53:43 +01:00
more conversion
This commit is contained in:
61
src/Corporation/ICorporation.ts
Normal file
61
src/Corporation/ICorporation.ts
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
import { Industry } from "./Industry";
|
||||||
|
import { IPlayer } from "../PersonObjects/IPlayer";
|
||||||
|
import { CorporationUnlockUpgrade } from "./data/CorporationUnlockUpgrades";
|
||||||
|
import { CorporationUpgrade } from "./data/CorporationUpgrades";
|
||||||
|
import { CorporationState } from "./CorporationState";
|
||||||
|
|
||||||
|
export interface ICorporation {
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
divisions: Industry[];
|
||||||
|
|
||||||
|
funds: any;
|
||||||
|
revenue: any;
|
||||||
|
expenses: any;
|
||||||
|
fundingRound: number;
|
||||||
|
public: boolean;
|
||||||
|
totalShares: number;
|
||||||
|
numShares: number;
|
||||||
|
shareSalesUntilPriceUpdate: number;
|
||||||
|
shareSaleCooldown: number;
|
||||||
|
issueNewSharesCooldown: number;
|
||||||
|
dividendPercentage: number;
|
||||||
|
dividendTaxPercentage: number;
|
||||||
|
issuedShares: number;
|
||||||
|
sharePrice: number;
|
||||||
|
storedCycles: number;
|
||||||
|
|
||||||
|
unlockUpgrades: number[];
|
||||||
|
upgrades: number[];
|
||||||
|
upgradeMultipliers: number[];
|
||||||
|
|
||||||
|
state: CorporationState;
|
||||||
|
|
||||||
|
addFunds(amt: number): void;
|
||||||
|
getState(): string;
|
||||||
|
storeCycles(numCycles: number): void;
|
||||||
|
process(player: IPlayer): void;
|
||||||
|
determineValuation(): number;
|
||||||
|
getTargetSharePrice(): number;
|
||||||
|
updateSharePrice(): void;
|
||||||
|
immediatelyUpdateSharePrice(): void;
|
||||||
|
calculateShareSale(numShares: number): [number, number, number];
|
||||||
|
convertCooldownToString(cd: number): string;
|
||||||
|
unlock(upgrade: CorporationUnlockUpgrade): void;
|
||||||
|
upgrade(upgrade: CorporationUpgrade): void;
|
||||||
|
getProductionMultiplier(): number;
|
||||||
|
getStorageMultiplier(): number;
|
||||||
|
getDreamSenseGain(): number;
|
||||||
|
getAdvertisingMultiplier(): number;
|
||||||
|
getEmployeeCreMultiplier(): number;
|
||||||
|
getEmployeeChaMultiplier(): number;
|
||||||
|
getEmployeeIntMultiplier(): number;
|
||||||
|
getEmployeeEffMultiplier(): number;
|
||||||
|
getSalesMultiplier(): number;
|
||||||
|
getScientificResearchMultiplier(): number;
|
||||||
|
getStarterGuide(player: IPlayer): void;
|
||||||
|
createUI(player: IPlayer): void;
|
||||||
|
rerender(player: IPlayer): void;
|
||||||
|
clearUI(): void;
|
||||||
|
toJSON(): any;
|
||||||
|
}
|
@ -5,13 +5,15 @@ import { CityTab } from "./CityTab";
|
|||||||
import { ExpandNewCityPopup } from "./ExpandNewCityPopup";
|
import { ExpandNewCityPopup } from "./ExpandNewCityPopup";
|
||||||
import { createPopup } from "../../ui/React/createPopup";
|
import { createPopup } from "../../ui/React/createPopup";
|
||||||
import { IDivision } from "../IDivision";
|
import { IDivision } from "../IDivision";
|
||||||
|
import { ICorporation } from "../ICorporation";
|
||||||
|
import { CorporationRouting } from "./Routing";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
routing: any;
|
routing: CorporationRouting;
|
||||||
onClicks: {[key: string]: () => void};
|
onClicks: {[key: string]: () => void};
|
||||||
city: string; // currentCity
|
city: string; // currentCity
|
||||||
cityStateSetter: (city: string) => void;
|
cityStateSetter: (city: string) => void;
|
||||||
corp: any;
|
corp: ICorporation;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CityTabs(props: IProps): React.ReactElement {
|
export function CityTabs(props: IProps): React.ReactElement {
|
||||||
|
@ -6,16 +6,20 @@ import { HeaderTab } from "./HeaderTab";
|
|||||||
import { IDivision } from "../IDivision";
|
import { IDivision } from "../IDivision";
|
||||||
import { NewIndustryPopup } from "./NewIndustryPopup";
|
import { NewIndustryPopup } from "./NewIndustryPopup";
|
||||||
import { createPopup } from "../../ui/React/createPopup";
|
import { createPopup } from "../../ui/React/createPopup";
|
||||||
|
import { ICorporation } from "../ICorporation";
|
||||||
|
import { CorporationRouting } from "./Routing";
|
||||||
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
corp: any;
|
corp: ICorporation;
|
||||||
routing: any;
|
routing: CorporationRouting;
|
||||||
|
player: IPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HeaderTabs(props: IProps): React.ReactElement {
|
export function HeaderTabs(props: IProps): React.ReactElement {
|
||||||
function overviewOnClick(): void {
|
function overviewOnClick(): void {
|
||||||
props.routing.routeToOverviewPage();
|
props.routing.routeToOverviewPage();
|
||||||
props.corp.rerender();
|
props.corp.rerender(props.player);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openNewIndustryPopup(): void {
|
function openNewIndustryPopup(): void {
|
||||||
@ -41,7 +45,7 @@ export function HeaderTabs(props: IProps): React.ReactElement {
|
|||||||
key={division.name}
|
key={division.name}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
props.routing.routeTo(division.name);
|
props.routing.routeTo(division.name);
|
||||||
props.corp.rerender();
|
props.corp.rerender(props.player);
|
||||||
}}
|
}}
|
||||||
text={division.name}
|
text={division.name}
|
||||||
/>)
|
/>)
|
||||||
|
@ -5,10 +5,12 @@ import React from "react";
|
|||||||
import { IndustryOffice } from "./IndustryOffice";
|
import { IndustryOffice } from "./IndustryOffice";
|
||||||
import { IndustryOverview } from "./IndustryOverview";
|
import { IndustryOverview } from "./IndustryOverview";
|
||||||
import { IndustryWarehouse } from "./IndustryWarehouse";
|
import { IndustryWarehouse } from "./IndustryWarehouse";
|
||||||
|
import { ICorporation } from "../ICorporation";
|
||||||
|
import { CorporationRouting } from "./Routing";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
routing: any;
|
routing: CorporationRouting;
|
||||||
corp: any;
|
corp: ICorporation;
|
||||||
currentCity: string;
|
currentCity: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,10 +11,12 @@ import { OfficeSpace } from "../OfficeSpace";
|
|||||||
|
|
||||||
import { CityName } from "../../Locations/data/CityNames";
|
import { CityName } from "../../Locations/data/CityNames";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
import { ICorporation } from "../ICorporation";
|
||||||
|
import { CorporationRouting } from "./Routing";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
corp: any;
|
corp: ICorporation;
|
||||||
routing: any;
|
routing: CorporationRouting;
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +54,7 @@ export function MainPanel(props: IProps): React.ReactElement {
|
|||||||
if (division.offices[cityName] instanceof OfficeSpace) {
|
if (division.offices[cityName] instanceof OfficeSpace) {
|
||||||
onClicks[cityName] = () => {
|
onClicks[cityName] = () => {
|
||||||
setCity(cityName);
|
setCity(cityName);
|
||||||
props.corp.rerender();
|
props.corp.rerender(props.player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,10 @@ import { numeralWrapper } from "../../ui/numeralFormat";
|
|||||||
import { convertTimeMsToTimeElapsedString } from "../../../utils/StringHelperFunctions";
|
import { convertTimeMsToTimeElapsedString } from "../../../utils/StringHelperFunctions";
|
||||||
import { createPopup } from "../../ui/React/createPopup";
|
import { createPopup } from "../../ui/React/createPopup";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
import { ICorporation } from "../ICorporation";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
corp: any;
|
corp: ICorporation;
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,17 +4,19 @@ import React from "react";
|
|||||||
import { HeaderTabs } from "./HeaderTabs";
|
import { HeaderTabs } from "./HeaderTabs";
|
||||||
import { MainPanel } from "./MainPanel";
|
import { MainPanel } from "./MainPanel";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
import { ICorporation } from "../ICorporation";
|
||||||
|
import { CorporationRouting } from "./Routing";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
corp: any;
|
corp: ICorporation;
|
||||||
routing: any;
|
routing: CorporationRouting;
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CorporationRoot(props: IProps): React.ReactElement {
|
export function CorporationRoot(props: IProps): React.ReactElement {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<HeaderTabs corp={props.corp} routing={props.routing} />
|
<HeaderTabs corp={props.corp} routing={props.routing} player={props.player} />
|
||||||
<MainPanel corp={props.corp} routing={props.routing} player={props.player} />
|
<MainPanel corp={props.corp} routing={props.routing} player={props.player} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user