diff --git a/Qwirkle/QwirkleClassLibrary/Game.cs b/Qwirkle/QwirkleClassLibrary/Game.cs index d86942a..50f6b36 100644 --- a/Qwirkle/QwirkleClassLibrary/Game.cs +++ b/Qwirkle/QwirkleClassLibrary/Game.cs @@ -387,8 +387,8 @@ namespace QwirkleClassLibrary return surroundingCells.Any(cell => cell?.GetTile != null); } - - + + public int GetPlayerScore(Player player, ReadOnlyCollection cellsPlayed, Board b) { @@ -429,7 +429,7 @@ namespace QwirkleClassLibrary int dx = adjacentCell.GetX - cell.GetX; int dy = adjacentCell.GetY - cell.GetY; - + if (adjacentCell.GetX == cell.GetX) { score += CalculateLineScore(cell, 0, dy, b); @@ -485,11 +485,11 @@ namespace QwirkleClassLibrary public bool CheckBoardTile(List PlayerTilesBagPos) { - for(int i=0; i PlayerTilesBagPos = CheckTilesBag(); - if (PlayerTilesBagPos.Count != 0) + if (PlayerTilesBagPos.Count != 0 && !CheckBoardTile(PlayerTilesBagPos)) { - if (!CheckBoardTile(PlayerTilesBagPos)) - { - OnEndOfGame(new EndOfGameNotifiedEventArgs(player)); - GameRunning = false; - return true; - } + OnEndOfGame(new EndOfGameNotifiedEventArgs(player)); + GameRunning = false; + return true; } return false;