for pathfinding we are now taking into consideration all tiles, looking for 'collides' property

This commit is contained in:
Hanusiak Piotr 2022-01-18 10:26:40 +01:00
parent 7576cea7e0
commit 391fe7eed3
3 changed files with 167 additions and 146 deletions

View file

@ -37,6 +37,15 @@ export class ActiveEventList {
any(): boolean {
return Array.from(this.eventMap.values()).reduce((accu, curr) => accu || curr, false);
}
anyExcept(...exceptions: UserInputEvent[]): boolean {
const userInputEvents = Array.from(this.eventMap);
for (const event of userInputEvents) {
if (event[1] && !exceptions.includes(event[0])) {
return true;
}
}
return false;
}
}
//this class is responsible for catching user inputs and listing all active user actions at every game tick events.