- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有人可以解释一下这个位掩码参数如何用于自动匹配游戏中的独占角色吗?是否有可能自动匹配具有独特角色的多个玩家?
这里提到了here
Your game can also use the exclusiveBitMask parameter in createAutoMatchCriteria() to pair auto-matched players who are interested in playing specific exclusive roles in a game.
还有api docs
public static Bundle createAutoMatchCriteria (int minAutoMatchPlayers,
int maxAutoMatchPlayers, long exclusiveBitMask)
Creates an auto-match criteria Bundle. Can be passed to createMatch(GoogleApiClient, TurnBasedMatchConfig) to create a match for a turn-based game.
Parameters minAutoMatchPlayers min number of auto-matched players. maxAutoMatchPlayers max number of auto-matched players. exclusiveBitMask exclusive bitmask for exclusive roles for the player. The exclusive bitmask of each pairing of players must equal zero for auto-match.
最佳答案
来自文档:
When auto-matching with this option, players will only be considered for a match when the logical AND of their exclusive bit masks is equal to 0.
因此,如果您在此掩码中设置了位,那么如果您的对手想与您配对,则他们也不能设置该位。
例如在国际象棋中,如果 A 想下白,B 想下黑,他们可以在这个掩码中指定(0x1 为白色,0x2 为黑色),并且可以配对。两个想下白棋的玩家将不会匹配。
面具为 0x0 的玩家可以与任何玩家配对,无论是白色还是黑色。
关于java - Android TurnBasedMultiplayer 与 exclusiveBitMask 自动匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21345656/
有人可以解释一下这个位掩码参数如何用于自动匹配游戏中的独占角色吗?是否有可能自动匹配具有独特角色的多个玩家? 这里提到了here Your game can also use the exclusiv
我是一名优秀的程序员,十分优秀!