2022-07-12 07:54:19 +02:00
|
|
|
import { IPlayer } from "../PersonObjects/IPlayer";
|
|
|
|
import { IReviverValue } from "../utils/JSONReviver";
|
2022-07-07 08:00:23 +02:00
|
|
|
|
|
|
|
export abstract class Work {
|
2022-07-10 07:37:36 +02:00
|
|
|
type: WorkType;
|
2022-07-12 07:54:19 +02:00
|
|
|
singularity: boolean;
|
2022-07-13 04:43:03 +02:00
|
|
|
cyclesWorked: number;
|
2022-07-10 07:37:36 +02:00
|
|
|
|
2022-07-12 07:54:19 +02:00
|
|
|
constructor(type: WorkType, singularity: boolean) {
|
2022-07-10 07:37:36 +02:00
|
|
|
this.type = type;
|
2022-07-12 07:54:19 +02:00
|
|
|
this.singularity = singularity;
|
2022-07-13 04:43:03 +02:00
|
|
|
this.cyclesWorked = 0;
|
2022-07-10 07:37:36 +02:00
|
|
|
}
|
2022-07-07 08:00:23 +02:00
|
|
|
|
|
|
|
abstract process(player: IPlayer, cycles: number): boolean;
|
|
|
|
abstract finish(player: IPlayer, cancelled: boolean): void;
|
2022-07-12 07:54:19 +02:00
|
|
|
abstract toJSON(): IReviverValue;
|
2022-07-07 08:00:23 +02:00
|
|
|
}
|
2022-07-07 23:28:23 +02:00
|
|
|
|
|
|
|
export enum WorkType {
|
|
|
|
CRIME = "CRIME",
|
|
|
|
CLASS = "CLASS",
|
2022-07-10 07:37:36 +02:00
|
|
|
CREATE_PROGRAM = "CREATE_PROGRAM",
|
|
|
|
GRAFTING = "GRAFTING",
|
2022-07-12 07:54:19 +02:00
|
|
|
FACTION = "FACTION",
|
2022-07-13 04:43:03 +02:00
|
|
|
COMPANY = "COMPANY",
|
2022-07-07 23:28:23 +02:00
|
|
|
}
|