Closed frbuccoliero closed 1 year ago
We need something to isolate the chat UI in CLI mode imo otherwise it will be very messy. Something like a separate terminal window.
We need something to isolate the chat UI in CLI mode imo otherwise it will be very messy. Something like a separate terminal window.
But I am not confident that a single executable can be spawned in two terminal processes.
Something like a separate terminal window.
I don't think this is viable. My take would be:
message handling --> CLI viz
thing run on a parallel thread so that every update can be shown asap to the userSystem.in
open at every time so that the user can just type all commands (moves and messages) when they feel it, if they're good they get sent, if they're not, they get a visual feedback (ERROR msg) and msg is not sent. Msg could follow some fashion like:
move 12 31 22 A
for move tiles x=1;y=2 , x=3;y=1 and x=2;y=2 to column A
for moves (ofc user should clearly see what is x,y and column, hopefully thanks to #107 )msg "optimus prime" "hey there I'm using whatsapp"
for private messagesmsg "hello everybody"
for broadcast messageslogout
And that should be it.
While writing CLI logic make particular attention to the fact that there's the chat -> you need to handle the CLI I/O asynchronously (e.g. you might receive a chat message, and therefore display it to the user, while you're asked to make a move; vice-versa, when player is NOT playing, should still be able to send messages.)