mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-14 03:33:52 +01:00
28 lines
809 B
TypeScript
28 lines
809 B
TypeScript
import { BaseServer } from "../Server/BaseServer";
|
|
import { ITerminal } from "../Terminal/ITerminal";
|
|
import { IPlayer } from "../PersonObjects/IPlayer";
|
|
import { IRouter } from "../ui/Router";
|
|
|
|
export interface IProgramCreate {
|
|
level: number;
|
|
req(p: IPlayer): boolean; // Function that indicates whether player meets requirements
|
|
time: number;
|
|
tooltip: string;
|
|
}
|
|
|
|
export class Program {
|
|
name = "";
|
|
create: IProgramCreate | null;
|
|
run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void;
|
|
|
|
constructor(
|
|
name: string,
|
|
create: IProgramCreate | null,
|
|
run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void,
|
|
) {
|
|
this.name = name;
|
|
this.create = create;
|
|
this.run = run;
|
|
}
|
|
}
|