//set single space private void SingleSpaceHighlight(int i, Vector2Int coords, SelectionSpace.Colors color) { var space = SelectionSpaces[i]; space.SetVisible(true); space.SetCoords(coords); space.SetColor(color); }
//highlight single space in tile footprint (not used for now because at the moment tiles dont have footprints) private void TileHighlight(Vector2Int coords, Puzzle.Tile tile) { SelectionSpace.Colors color = SelectionSpace.Colors.White; var puzzle = this.Manager.PuzzleController.Puzzle; //if out of the board if (puzzle.OutOfBounds(coords) || !puzzle.IsFree(coords, tile)) { color = SelectionSpace.Colors.Red; } SingleSpaceHighlight(0, coords, color); }
//highlight single space in footprint private void PieceFootprintHighlight(int i, Vector2Int boardCoords, Puzzle.Piece piece, Vector2Int offset = default) { SelectionSpace.Colors color = SelectionSpace.Colors.White; var puzzle = this.Manager.PuzzleController.Puzzle; var coords = boardCoords + offset; if (puzzle.OutOfBounds(coords)) { color = SelectionSpace.Colors.Red; } else if (!puzzle.IsFree(boardCoords, piece)) { var overlap = puzzle.GetPiece(coords); if (overlap != null && overlap != piece) { color = SelectionSpace.Colors.Red; } } SingleSpaceHighlight(i, coords, color); }