我需要匹配3个玩家,1个巫师和2个战士作为属性。GKMatch 如何做到这一点?以下片段来自我的代码
var wizard = true
enum Role : UInt32 {
case wizard = 0xffff0000
case warrior = 0x0000ffff
}
let matchRequest = GKMatchRequest()
matchRequest.minPlayers = 3
matchRequest.maxPlayers = 3
matchRequest.playerAttributes = wizard ? Role.wizard.rawValue : Role.warrior.rawValue
let matchMakerViewController = GKMatchmakerViewController(matchRequest: matchRequest)
matchMakerViewController.matchmakerDelegate = self
presentingViewController?.presentViewController(matchMakerViewController, animated: false, completion:nil)
为两名球员(一名巫师和一名战士)设置一切,效果很好,但我需要 2 名战士进行比赛。
先感谢您