fix: code review — 清理CardTracker死代码 + IsmctsBot未使用变量

CardTracker.BombsOutside: 删除13行注释+空循环(seenByRank从未填充)
IsmctsBot: 删除未使用的bombRanks变量
This commit is contained in:
2026-07-12 22:51:48 +08:00
parent cb33dcac6c
commit 4263146487
8 changed files with 0 additions and 13 deletions

View File

@ -132,21 +132,9 @@ namespace PdkFriendServer.Logic
foreach (var c in myHand.Where(c => c.GameState == 1))
myCounts[c.GameNum] = myCounts.GetValueOrDefault(c.GameNum, 0) + 1;
// 对每个 rank: total=4, my=N, seen=M, outside=4-N-M
// 但 seen 按 ID 不按 rank简化统计已知牌中各 rank 的已出数
var seenByRank = new Dictionary<int, int>();
foreach (var id in _seenCardIds)
{
// 通过 ID 反推 rankID 1-52, rank=(ID-1)%13+1, 但 GameNum 映射不同)
// 简化:用 GameNum 直接。实际上 ID 与 GameNum 的映射由 Deal 决定。
// 我们采用近似:外面未见的牌如果某个 rank 还有 4 张 → 可能有炸弹
}
// 简化版:检查常见 rank
foreach (int rank in new[] { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 })
{
int myCount = myCounts.GetValueOrDefault(rank, 0);
// 近似:用 rank 对应 ID 范围推算已见数
int seenCount = CountSeenByRank(rank);
int outside = 4 - myCount - seenCount;
if (outside == 4) bombs++;

View File

@ -171,7 +171,6 @@ namespace PdkFriendServer.Logic
// 5. 炸弹感知加权
int bombsOutside = _tracker.BombsOutside(hand);
var bombRanks = _tracker.BombRanks(hand);
for (int i = 0; i < scoredCandidates.Count; i++)
{

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.