refactor: iterateForEach
This commit is contained in:
parent
9f6cae5b9b
commit
e814e80682
|
@ -5,6 +5,7 @@ import {
|
|||
buildTraversal,
|
||||
Context,
|
||||
} from '@avocado/behavior';
|
||||
import {iterateForEach} from '@avocado/core';
|
||||
import {hasGraphics, TextNodeRenderer} from '@avocado/graphics';
|
||||
import {randomNumber, Vector} from '@avocado/math';
|
||||
|
||||
|
@ -345,13 +346,7 @@ export class Vulnerable extends Trait {
|
|||
this.damageTickingPromises[i].tick(elapsed);
|
||||
}
|
||||
if (AVOCADO_SERVER) {
|
||||
const keyIterator = this.locks.keys();
|
||||
for (
|
||||
let thisKey = keyIterator.next();
|
||||
thisKey.done !== true;
|
||||
thisKey = keyIterator.next()
|
||||
) {
|
||||
const {value: key} = thisKey;
|
||||
iterateForEach(this.locks.keys(), (key) => {
|
||||
const remaining = this.locks.get(key) - elapsed;
|
||||
if (remaining <= 0) {
|
||||
this.locks.delete(key);
|
||||
|
@ -359,7 +354,7 @@ export class Vulnerable extends Trait {
|
|||
else {
|
||||
this.locks.set(key, remaining);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user