File tree Expand file tree Collapse file tree
src/main/kotlin/ru/octol1ttle/flightassistant/api/util/extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,13 +9,14 @@ import ru.octol1ttle.flightassistant.api.computer.Computer
99 * If there are no such inputs, the returned list contains all inputs with the highest priority in the list.
1010 */
1111fun List<ControlInput>.getActiveHighestPriority (): List <ControlInput > {
12- // TODO
13- val activeInput: List <ControlInput > = this .filter { it.status == ControlInput .Status .ACTIVE && it.priority.value == this [0 ].priority.value }
12+ // TODO: Disabled inputs should not be submitted in the first place
13+ val noDisabled = this .filter { it.status != ControlInput .Status .DISABLED }
14+ val activeInput: List <ControlInput > = noDisabled.filter { it.status == ControlInput .Status .ACTIVE && it.priority.value == noDisabled[0 ].priority.value }
1415 if (activeInput.any()) {
1516 return activeInput
1617 }
1718
18- return this .filter { it.priority.value == this [0 ].priority.value }
19+ return noDisabled .filter { it.priority.value == noDisabled [0 ].priority.value }
1920}
2021
2122/* *
You can’t perform that action at this time.
0 commit comments