|
|
|
@ -160,7 +160,7 @@ namespace QwirkleClassLibrary
|
|
|
|
|
{
|
|
|
|
|
foreach (var p in players)
|
|
|
|
|
{
|
|
|
|
|
for (int j = 0; j < 6; j++) // ici pour test
|
|
|
|
|
for (int j = 0; j < 6; j++)
|
|
|
|
|
{
|
|
|
|
|
int val = RandomNumberGenerator.GetInt32(0, bag.TilesBag.Count);
|
|
|
|
|
|
|
|
|
@ -249,13 +249,13 @@ namespace QwirkleClassLibrary
|
|
|
|
|
|
|
|
|
|
foreach (var t in tilesToSwap)
|
|
|
|
|
{
|
|
|
|
|
if (player.RemoveTileToPlayer(t) == false)
|
|
|
|
|
if (!player.RemoveTileToPlayer(t))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (DrawTiles(player) == false)
|
|
|
|
|
if (!DrawTiles(player))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -374,13 +374,13 @@ namespace QwirkleClassLibrary
|
|
|
|
|
var dx = cell.GetX - x;
|
|
|
|
|
var dy = cell.GetY - y;
|
|
|
|
|
|
|
|
|
|
if (CheckExtendedSurroundingCells(t, x, y, dx, dy, b) == false)
|
|
|
|
|
if (!CheckExtendedSurroundingCells(t, x, y, dx, dy, b))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CheckTilesInLine(cellUsed, b, x, y) == false)
|
|
|
|
|
if (!CheckTilesInLine(cellUsed, b, x, y))
|
|
|
|
|
{
|
|
|
|
|
OnPlaceTile(new PlaceTileNotifiedEventArgs(t, "isn't on the same line as the ones previously placed !"));
|
|
|
|
|
return false;
|
|
|
|
@ -399,7 +399,7 @@ namespace QwirkleClassLibrary
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(scoreBoard.TryAdd(player, score) == false)
|
|
|
|
|
if(!scoreBoard.TryAdd(player, score))
|
|
|
|
|
{
|
|
|
|
|
scoreBoard[player] += score;
|
|
|
|
|
}
|
|
|
|
@ -435,7 +435,7 @@ namespace QwirkleClassLibrary
|
|
|
|
|
return score;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int CalculateLineScore(Cell cell, int dx, int dy, Board b)
|
|
|
|
|
private static int CalculateLineScore(Cell cell, int dx, int dy, Board b)
|
|
|
|
|
{
|
|
|
|
|
int score = 0;
|
|
|
|
|
|
|
|
|
@ -459,7 +459,6 @@ namespace QwirkleClassLibrary
|
|
|
|
|
{
|
|
|
|
|
OnEndOfGame(new EndOfGameNotifiedEventArgs(player));
|
|
|
|
|
GameRunning = false;
|
|
|
|
|
//ScoreBoard.ToImmutableSortedDictionary();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|