开发者

Java multiplayer card game AI integration

开发者 https://www.devze.com 2023-01-10 11:12 出处:网络
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 in

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开发者_Python百科 separate thread for each player?

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消