Try of getPlayerScore
continuous-integration/drone/push Build is passing Details

test_old_branch
Jules LASCRET 11 months ago
parent 8b70054950
commit 3aa52e3ae7

@ -388,6 +388,8 @@ namespace QwirkleClassLibrary
return surroundingCells.Any(cell => cell?.GetTile != null);
}
public int GetPlayerScore(Player player, ReadOnlyCollection<Cell> cellsPlayed, Board b)
{
int score = cellsPlayed.Count;
@ -430,12 +432,12 @@ namespace QwirkleClassLibrary
if (adjacentCell.GetX == cell.GetX)
{
score += CalculateLineScore(cell, dx, 1, b);
score += CalculateLineScore(cell, 0, dy, b);
}
else
else if (adjacentCell.GetY == cell.GetY)
{
score += CalculateLineScore(cell, 1, dy, b);
score += CalculateLineScore(cell, dx, 0, b);
}
}

Loading…
Cancel
Save