Implement anarchy mode
This commit is contained in:
parent
3b459606e4
commit
a09b5cc9d1
@ -186,3 +186,21 @@ async def _(get_input: InputGetter, set_output: OutputSetter):
|
|||||||
output[choice] = True
|
output[choice] = True
|
||||||
|
|
||||||
set_output(output)
|
set_output(output)
|
||||||
|
|
||||||
|
|
||||||
|
@arbiter.mode("anarchy", allow_multitouch=False)
|
||||||
|
async def _(get_input: InputGetter, set_output: OutputSetter):
|
||||||
|
while True:
|
||||||
|
await asyncio.sleep(settings.democracy_vote_cycle)
|
||||||
|
|
||||||
|
inputs: list[Input] = await get_input()
|
||||||
|
|
||||||
|
the_input = random.choice(inputs)
|
||||||
|
|
||||||
|
if not the_input:
|
||||||
|
set_output(EMPTY_INPUT)
|
||||||
|
continue
|
||||||
|
|
||||||
|
output = {button: the_input[button] for button in Button}
|
||||||
|
|
||||||
|
set_output(output)
|
||||||
|
Loading…
Reference in New Issue
Block a user