Game/Pieces/King.cs
/// <summary>
/// Reusable method for calculating valid position within the board
/// </summary>
/// <param name="board"></param>
/// <param name="corner"></param>
/// <param name="op"></param>
/// <returns></returns>
Reusable method for calculating valid position within the board
Reusable method for calculating valid position within the board
private IEnumerable<Coords> HandleCoords(Tile[] board, int corner, Func<int, int> op)
        {
            List<Coords> coordsList = new List<Coords>();
            if(!ValidCoordinate(board, (Coords) op((int) Coords), corner))
                return coordsList;
            coordsList.Add((Coords) op((int) Coords));
            return coordsList;
        }
private IEnumerable < Coords > HandleCoords ( Tile [ ] board , int corner , Func < int , int > op ) { List < Coords > coordsList = new List < Coords > ( ) ; if ( ! ValidCoordinate ( board , ( Coords ) op ( ( int ) Coords ) , corner ) ) return coordsList ; coordsList . Add ( ( Coords ) op ( ( int ) Coords ) ) ; return coordsList ; }
Reusable method for calculating valid position within the board
Reusable method for calculating valid position within the board
None
board
Tile[]
None
corner
int
None
op
Func<int, int>
None