views:

39

answers:

1

Hello;

I have developed a Multi-player Client/Server Variation of Trumps Card Game using QuickServer library. It works well with 4 human players. But when I finished the AI player, I didn't find a way to integrate it into the server: Should I create a separate thread for each player?

I hope my question is clear. Any suggestions would be highly appreciated.

A: 

A server should just be a server. In this case, it updates the clients as to what happened and what happens next.

If it were me, I would have a AIClientPlayer, which gets passed a client, and acts using your fancy AI logic when the client signals it to act.

hvgotcodes