This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
init: function(elevators, floors) { | |
console.log("START"); | |
const upIndicators = new Set(); | |
const downIndicators = new Set(); | |
// TODO: Let the floor button presses control the elevator queues (big rewrite) | |
const TOP_FLOOR_NUM = floors.length - 1; | |
const goingUp = floors => floors.filter(floor => floor.buttonStates.up === "activated"); | |
const goingDown = floors => floors.filter(floor => floor.buttonStates.down === "activated"); |