Player is now a Person

Use correct class inheritance, use class as type and remove IPlayer
This commit is contained in:
Snarling
2022-09-20 01:57:46 -04:00
parent 475a8812bb
commit c510e47885
24 changed files with 297 additions and 518 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import { IPerson } from "src/PersonObjects/IPerson";
import { Person } from "src/PersonObjects/Person";
import { Player } from "../Player";
export interface WorkStats {
@@ -68,7 +68,7 @@ export const scaleWorkStats = (w: WorkStats, n: number, scaleMoney = true): Work
};
};
export const applyWorkStats = (target: IPerson, workStats: WorkStats, cycles: number, source: string): WorkStats => {
export const applyWorkStats = (target: Person, workStats: WorkStats, cycles: number, source: string): WorkStats => {
const expStats = applyWorkStatsExp(target, workStats, cycles);
const gains = {
money: workStats.money * cycles,
@@ -86,7 +86,7 @@ export const applyWorkStats = (target: IPerson, workStats: WorkStats, cycles: nu
return gains;
};
export const applyWorkStatsExp = (target: IPerson, workStats: WorkStats, cycles: number): WorkStats => {
export const applyWorkStatsExp = (target: Person, workStats: WorkStats, cycles: number): WorkStats => {
const gains = {
money: 0,
reputation: 0,