Formatted/linted (There are some errors, but they aren't mine afaik)

This commit is contained in:
Undeemiss
2022-05-28 21:35:20 -05:00
parent 8b026f606b
commit f8f3c099e0
18 changed files with 293 additions and 292 deletions
+6 -4
View File
@@ -257,7 +257,7 @@ export function NetscriptCorporation(player: IPlayer, workerScript: WorkerScript
function getMaterial(divisionName: string, cityName: string, materialName: string): Material {
const warehouse = getWarehouse(divisionName, cityName);
const matName = (materialName ).replace(/ /g, "");
const matName = materialName.replace(/ /g, "");
const material = warehouse.materials[matName];
if (material === undefined) throw new Error(`Invalid material name: '${materialName}'`);
return material;
@@ -725,9 +725,11 @@ export function NetscriptCorporation(player: IPlayer, workerScript: WorkerScript
const employeeName = ctx.helper.string("employeeName", _employeeName);
const job = ctx.helper.string("job", _job);
const employee = getEmployee(divisionName, cityName, employeeName);
return netscriptDelay(["Training", "Unassigned"].includes(employee.pos) ? 0 : 1000, workerScript).then(function () {
return Promise.resolve(AssignJob(employee, job));
});
return netscriptDelay(["Training", "Unassigned"].includes(employee.pos) ? 0 : 1000, workerScript).then(
function () {
return Promise.resolve(AssignJob(employee, job));
},
);
},
hireEmployee:
(ctx: NetscriptContext) =>