So I am programming a Poker game im C++ and first it was done with terminal only where I would get the input from cin (check or fold or ...) and program reacts based on the input in a while(true) loop.
Now I want to do the same in Qt with GUI where after clicking 'start' the game is created and then in a while(true) loop we are waiting for a signal of fold or check or raise or call button and we react based on that.
How can I implement this? Basically:
while (true) {
If (signal== button-fold) // do a;
else if (signal == button-check ) // do b;
}
qthere. I would do what you say in QML and Javascript and make use of Promises. Promises give us the ability to put our thoughts in a sequential manner, even though the actors behind each bit are actually asynchronous. i.e. we don't know when the user will click, but, when the user does click, we can move to the next step in our Promise chain.