2018-12-25 11:14:18 +01:00
|
|
|
export interface IPlayer {
|
2021-09-05 01:09:30 +02:00
|
|
|
hacking_skill: number;
|
|
|
|
sourceFiles: any[];
|
2018-12-25 11:14:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IProgramCreate {
|
2021-09-05 01:09:30 +02:00
|
|
|
level: number;
|
|
|
|
req(p: IPlayer): boolean; // Function that indicates whether player meets requirements
|
|
|
|
time: number;
|
|
|
|
tooltip: string;
|
2018-12-25 11:14:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Program {
|
2021-09-05 01:09:30 +02:00
|
|
|
name = "";
|
|
|
|
create: IProgramCreate | null;
|
2018-12-25 11:14:18 +01:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
constructor(name: string, create: IProgramCreate | null) {
|
|
|
|
this.name = name;
|
|
|
|
this.create = create;
|
|
|
|
}
|
2018-12-25 11:14:18 +01:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
htmlID(): string {
|
2021-09-09 05:47:34 +02:00
|
|
|
const name = this.name.endsWith(".exe") ? this.name.slice(0, -".exe".length) : this.name;
|
2021-09-05 01:09:30 +02:00
|
|
|
return "create-program-" + name;
|
|
|
|
}
|
2018-12-25 11:14:18 +01:00
|
|
|
}
|