您好,我有一个玩家队列,想要获得第一个满足我的两个条件之一的玩家,但我不确定如何做到这一点。
首先,我得到一个玩家 (mmr) 的值,并希望从队列中获得一个(只有一个)玩家,该玩家的值或多或少 5%
我认为我的情况是获得或多或少 5%:
const condition = (5/100)*playerOne.mmr + playerOne.mmr
const condition2 = (5/100)*playerOne.mmr - playerOne.mmr
我的功能:
makeMatch(playerOne) {
// make matched players
const condition = (5/100)*playerOne.mmr + playerOne.mmr
const condition2 = (5/100)*playerOne.mmr - playerOne.mmr
const player = playerOne;
const matchedPlayer = this.players.find();
// remove matched players from this.players
this.removePlayers(matchedPlayers);
// return new Match with matched players
return new Match(matchedPlayers);
}
我有疑问,因为我会在我的发现中获得或多或少 5%
哔哔one
智慧大石
相关分类