gpt4 book ai didi

iPhone Deck 游戏循环

转载 作者:行者123 更新时间:2023-12-03 21:22:43 25 4
gpt4 key购买 nike

谁能告诉我运行像 Uno 或 Hearts (Deck Game) 这样的游戏循环的最佳方法

[CPU2 turn];
[CPU3 turn];
[User turn]; // Wait to get user input before proceed to [CPU4 turn]
[CPU4 turn];

最佳答案

也许您可以将轮流转换为放置到 NSOperationQueue 中的 NSOperation 子类实例,该实例设置为仅允许一次并发轮流/操作。在这种情况下,轮次按先进先出 (FIFO) 顺序处理。您可以在 Apple 的 Managing Concurrency 中阅读更多相关信息。文档。

关于iPhone Deck 游戏循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3263327/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com