seatTranslation便捷写法拓展

This commit is contained in:
157 2024-03-28 20:07:52 +08:00
parent 1aeb2cd227
commit 6af2a4174f
1 changed files with 7 additions and 4 deletions

View File

@ -53,10 +53,13 @@ export class Get extends Uninstantable {
return list;
}
/**
* 根据座次数n从0开始获取对应的n+1号位翻译
* @param {number} seat
* 根据(Player的)座次数n从1开始获取对应的n号位翻译
* @param {number | Player} seat
*/
static seatTranslation(seat) { return `${get.cnNumber(seat + 1, true)}号位`; }
static seatTranslation(seat) {
if (get.itemtype(seat) === 'player') seat = seat.getSeatNum();
return `${get.cnNumber(seat, true)}号位`;
}
/**
* @param {number} numberOfPlayers
* @returns {string[]}
@ -4685,7 +4688,7 @@ export class Get extends Uninstantable {
return eff;
}
/**
*
*
* @param {any} source 如果参数是function执行此函数并返回结果传参为此方法剩余的参数如果参数不是function直接返回结果
* @returns 返回的结果
*/