From 54e6e2de6bb731ea3f4eefc4a8fd89d67f987e3d Mon Sep 17 00:00:00 2001 From: "jeremy.mouyon" Date: Fri, 17 May 2024 15:56:12 +0200 Subject: [PATCH] push --- Qwirkle/QwirkleClassLibrary/Game.cs | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) 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;