|
|
|
@ -119,7 +119,7 @@ namespace Models.Game
|
|
|
|
|
/// <param name="result">The result of the dice operation to be placed in the cell.</param>
|
|
|
|
|
private void PlaceResult(Cell playerChoice, int result)
|
|
|
|
|
{
|
|
|
|
|
if (Turn == 1 || GameRules.NearCellIsValid(playerChoice, UsedMap.Boards))
|
|
|
|
|
if (Turn == 1 || GameRules.NearCellIsValid(playerChoice, UsedMap.Boards.ToList()))
|
|
|
|
|
{
|
|
|
|
|
playerChoice.Value = result;
|
|
|
|
|
BoardUpdated?.Invoke(this, EventArgs.Empty);
|
|
|
|
@ -226,14 +226,14 @@ namespace Models.Game
|
|
|
|
|
throw new InvalidCellCoordinatesException("Invalid cell coordinates. Please choose again.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!GameRules.IsCellValid(cell, UsedMap.Boards))
|
|
|
|
|
if (!GameRules.IsCellValid(cell, UsedMap.Boards.ToList()))
|
|
|
|
|
{
|
|
|
|
|
throw new InvalidCellException("Cell is not valid. Please choose again.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlaceResult(cell, result);
|
|
|
|
|
GameRules.IsZoneValidAndAddToZones(cell, UsedMap);
|
|
|
|
|
AddToRopePath(cell, GameRules.EveryAdjacentCells(cell, UsedMap.Boards));
|
|
|
|
|
AddToRopePath(cell, GameRules.EveryAdjacentCells(cell, UsedMap.Boards.ToList()));
|
|
|
|
|
CellChosen?.Invoke(this, new CellChosenEventArgs(cell, result));
|
|
|
|
|
BoardUpdated?.Invoke(this, EventArgs.Empty);
|
|
|
|
|
}
|
|
|
|
|