Refactor for ... in loops

This commit is contained in:
nickofolas
2022-01-15 18:45:03 -06:00
parent d5c3d89613
commit ab841f7530
54 changed files with 128 additions and 130 deletions
+5 -5
View File
@@ -36,7 +36,7 @@ export function Factions(props: IProps): React.ReactElement {
}
function receiveAllInvites(): void {
for (const i in AllFaction) {
for (const i of Object.keys(AllFaction)) {
props.player.receiveInvite(AllFaction[i].name);
}
}
@@ -74,25 +74,25 @@ export function Factions(props: IProps): React.ReactElement {
}
function tonsOfRep(): void {
for (const i in AllFaction) {
for (const i of Object.keys(AllFaction)) {
AllFaction[i].playerReputation = bigNumber;
}
}
function resetAllRep(): void {
for (const i in AllFaction) {
for (const i of Object.keys(AllFaction)) {
AllFaction[i].playerReputation = 0;
}
}
function tonsOfFactionFavor(): void {
for (const i in AllFaction) {
for (const i of Object.keys(AllFaction)) {
AllFaction[i].favor = bigNumber;
}
}
function resetAllFactionFavor(): void {
for (const i in AllFaction) {
for (const i of Object.keys(AllFaction)) {
AllFaction[i].favor = 0;
}
}