mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
Remove IPlayer interface
Use PlayerObject instead when referring to the type of "The Player."
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
import { Work } from "../../Work/Work";
|
||||
import { IPlayer } from "../IPlayer";
|
||||
import { PlayerObject } from "./PlayerObject";
|
||||
|
||||
export function start(this: IPlayer, w: Work): void {
|
||||
export function startWork(this: PlayerObject, w: Work): void {
|
||||
if (this.currentWork !== null) {
|
||||
this.currentWork.finish(true);
|
||||
}
|
||||
this.currentWork = w;
|
||||
}
|
||||
export function process(this: IPlayer, cycles = 1): void {
|
||||
export function processWork(this: PlayerObject, cycles = 1): void {
|
||||
if (this.currentWork === null) return;
|
||||
const finished = this.currentWork.process(cycles);
|
||||
if (finished) {
|
||||
this.finishWork(false);
|
||||
}
|
||||
}
|
||||
export function finish(this: IPlayer, cancelled: boolean): void {
|
||||
export function finishWork(this: PlayerObject, cancelled: boolean): void {
|
||||
if (this.currentWork === null) return;
|
||||
this.currentWork.finish(cancelled);
|
||||
this.currentWork = null;
|
||||
|
||||
Reference in New Issue
Block a user