Rename getDividends to getCycleDividends for clarity

This commit is contained in:
Staszek Welsh 2022-06-01 12:59:45 +01:00
parent 4a3558098c
commit eb46e4d156
4 changed files with 5 additions and 5 deletions

@ -133,7 +133,7 @@ export class Corporation {
} else {
const totalDividends = this.dividendRate * cycleProfit;
const retainedEarnings = cycleProfit - totalDividends;
player.gainMoney(this.getDividends(), "corporation");
player.gainMoney(this.getCycleDividends(), "corporation");
this.addFunds(retainedEarnings);
}
} else {
@ -157,7 +157,7 @@ export class Corporation {
}
}
getDividends(): number {
getCycleDividends(): number {
const profit = this.revenue - this.expenses;
const cycleProfit = profit * CorporationConstants.SecsPerMarketCycle;
const totalDividends = this.dividendRate * cycleProfit;

@ -55,6 +55,6 @@ export interface ICorporation {
getScientificResearchMultiplier(): number;
getStarterGuide(player: IPlayer): void;
updateDividendTax(): void;
getDividends(): number;
getCycleDividends(): number;
toJSON(): any;
}

@ -279,7 +279,7 @@ function DividendsStats({ profit }: IDividendsStatsProps): React.ReactElement {
const totalDividends = corp.dividendRate * profit;
const retainedEarnings = profit - totalDividends;
const dividendsPerShare = totalDividends / corp.totalShares;
const playerEarnings = corp.getDividends() / CorporationConstants.SecsPerMarketCycle;
const playerEarnings = corp.getCycleDividends() / CorporationConstants.SecsPerMarketCycle;
return (
<StatsTable
rows={[

@ -955,7 +955,7 @@ export function NetscriptCorporation(player: IPlayer, workerScript: WorkerScript
sharePrice: corporation.sharePrice,
dividendRate: corporation.dividendRate,
dividendTax: corporation.dividendTax,
dividendEarnings: corporation.getDividends() / CorporationConstants.SecsPerMarketCycle,
dividendEarnings: corporation.getCycleDividends() / CorporationConstants.SecsPerMarketCycle,
state: corporation.state.getState(),
divisions: corporation.divisions.map((division): NSDivision => getSafeDivision(division)),
};