mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-28 08:57:32 +01:00
Reduce repetitive code sections
Iteratively define general actions instead of defining each individually. Remove anonymous function that automatically runs, placing code into main section of file so that it still automatically runs. (untested - I don't have a local copy set up yet to test these changes on)
This commit is contained in:
parent
cfa10ab206
commit
f105002847
@ -3,35 +3,16 @@ import { IMap } from "../types";
|
||||
|
||||
export const GeneralActions: IMap<Action> = {};
|
||||
|
||||
(function () {
|
||||
// General Actions
|
||||
let actionName;
|
||||
actionName = "Training";
|
||||
GeneralActions[actionName] = new Action({
|
||||
name: actionName,
|
||||
});
|
||||
|
||||
actionName = "Field Analysis";
|
||||
GeneralActions[actionName] = new Action({
|
||||
name: actionName,
|
||||
});
|
||||
|
||||
actionName = "Recruitment";
|
||||
GeneralActions[actionName] = new Action({
|
||||
name: actionName,
|
||||
});
|
||||
|
||||
actionName = "Diplomacy";
|
||||
GeneralActions[actionName] = new Action({
|
||||
name: actionName,
|
||||
});
|
||||
|
||||
actionName = "Hyperbolic Regeneration Chamber";
|
||||
GeneralActions[actionName] = new Action({
|
||||
name: actionName,
|
||||
});
|
||||
actionName = "Incite Violence";
|
||||
GeneralActions[actionName] = new Action({
|
||||
name: actionName,
|
||||
});
|
||||
})();
|
||||
let actionNames : Array<string> = [
|
||||
"Training",
|
||||
"Field Analysis",
|
||||
"Recruitment",
|
||||
"Diplomacy",
|
||||
"Hyperbolic Regeneration Chamber",
|
||||
"Incite Violence"
|
||||
];
|
||||
for (let actionName of actionNames){
|
||||
GeneralActions[actionName] = new Action({
|
||||
name: actionName,
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user