push
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 1 year ago
parent de67308589
commit 54e6e2de6b

@ -387,8 +387,8 @@ namespace QwirkleClassLibrary
return surroundingCells.Any(cell => cell?.GetTile != null); return surroundingCells.Any(cell => cell?.GetTile != null);
} }
public int GetPlayerScore(Player player, ReadOnlyCollection<Cell> cellsPlayed, Board b) public int GetPlayerScore(Player player, ReadOnlyCollection<Cell> cellsPlayed, Board b)
{ {
@ -429,7 +429,7 @@ namespace QwirkleClassLibrary
int dx = adjacentCell.GetX - cell.GetX; int dx = adjacentCell.GetX - cell.GetX;
int dy = adjacentCell.GetY - cell.GetY; int dy = adjacentCell.GetY - cell.GetY;
if (adjacentCell.GetX == cell.GetX) if (adjacentCell.GetX == cell.GetX)
{ {
score += CalculateLineScore(cell, 0, dy, b); score += CalculateLineScore(cell, 0, dy, b);
@ -485,11 +485,11 @@ namespace QwirkleClassLibrary
public bool CheckBoardTile(List<int> PlayerTilesBagPos) public bool CheckBoardTile(List<int> PlayerTilesBagPos)
{ {
for(int i=0; i<PlayerTilesBagPos.Count; i++) for (int i = 0; i < PlayerTilesBagPos.Count; i++)
{ {
for(int j=0; j < this.players[PlayerTilesBagPos[i]].Tiles.Count; j++) for (int j = 0; j < this.players[PlayerTilesBagPos[i]].Tiles.Count; j++)
{ {
for(int b=0; b < this.board.ReadCells.Count; b++) for (int b = 0; b < this.board.ReadCells.Count; b++)
{ {
int x = this.board.ReadCells[b].GetX; int x = this.board.ReadCells[b].GetX;
int y = this.board.ReadCells[b].GetY; int y = this.board.ReadCells[b].GetY;
@ -498,7 +498,7 @@ namespace QwirkleClassLibrary
{ {
return true; return true;
} }
} }
} }
} }
@ -510,14 +510,11 @@ namespace QwirkleClassLibrary
{ {
List<int> PlayerTilesBagPos = CheckTilesBag(); List<int> PlayerTilesBagPos = CheckTilesBag();
if (PlayerTilesBagPos.Count != 0) if (PlayerTilesBagPos.Count != 0 && !CheckBoardTile(PlayerTilesBagPos))
{ {
if (!CheckBoardTile(PlayerTilesBagPos)) OnEndOfGame(new EndOfGameNotifiedEventArgs(player));
{ GameRunning = false;
OnEndOfGame(new EndOfGameNotifiedEventArgs(player)); return true;
GameRunning = false;
return true;
}
} }
return false; return false;

Loading…
Cancel
Save