Remove more execute-on-import code

This commit is contained in:
Snarling 2022-09-13 13:18:09 -04:00
parent 1ac57d2e48
commit 88e2cdf09c
2 changed files with 6 additions and 4 deletions

@ -1,9 +1,10 @@
import { DarkWebItem } from "./DarkWebItem";
import { IMap } from "../types";
import { Programs } from "../Programs/Programs";
import { Programs, initPrograms } from "../Programs/Programs";
export const DarkWebItems: IMap<DarkWebItem> = {};
export function initDarkWebItems() {
initPrograms();
Object.assign(DarkWebItems, {
BruteSSHProgram: new DarkWebItem(Programs.BruteSSHProgram.name, 500e3, "Opens up SSH Ports."),
FTPCrackProgram: new DarkWebItem(Programs.FTPCrackProgram.name, 1500e3, "Opens up FTP Ports."),

@ -3,7 +3,8 @@ import { programsMetadata } from "./data/ProgramsMetadata";
import { IMap } from "../types";
export const Programs: IMap<Program> = {};
export function initPrograms() {
for (const params of programsMetadata) {
Programs[params.key] = new Program(params.name, params.create, params.run);
}
}