Somewhere you have an array / vector / list of all the game characters.
So your UI first traverses this list to populate your combobox dialog.
Code:
[x] player 1 [ ] player 1
[ ] player 2 [ ] player 2
[ ] player 3 [x] player 3
[ ] player 4 [ ] player 4
PUNCH!
Your punch button callback handler inspects the check boxes to check for things like
- only two players selected.
- a player isn't trying to punch themselves.
Then I imagine you would then be able to do something like
Code:
players[selection2].punch( players[selection1].getStrength );
which means the selected player2 is punched with the strength of the selected player1.
Then perhaps you do something like
Code:
if ( ! players[selection2].isConscious() ) {
// It's a KO!
}