bitburner-src/src/Work/Work.ts

28 lines
681 B
TypeScript
Raw Normal View History

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;
singularity: boolean;
cyclesWorked: number;
2022-07-10 07:37:36 +02:00
constructor(type: WorkType, singularity: boolean) {
2022-07-10 07:37:36 +02:00
this.type = type;
this.singularity = singularity;
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;
abstract toJSON(): IReviverValue;
2022-07-07 08:00:23 +02:00
}
export enum WorkType {
CRIME = "CRIME",
CLASS = "CLASS",
2022-07-10 07:37:36 +02:00
CREATE_PROGRAM = "CREATE_PROGRAM",
GRAFTING = "GRAFTING",
FACTION = "FACTION",
COMPANY = "COMPANY",
}