public static IEnumerable <BoardPosition> GetKingMoves(BoardPosition pos, ChessBoard board)
        {
            List <BoardPosition> moves = new List <BoardPosition>();
            BoardPosition        left  = new BoardPosition(pos.Row, pos.Col - 1);

            if (ChessBoard.PositionInBounds(left))
            {
                moves.Add(left);
            }
            BoardPosition right = new BoardPosition(pos.Row, pos.Col + 1);

            if (ChessBoard.PositionInBounds(right))
            {
                moves.Add(right);
            }

            BoardPosition front = new BoardPosition(pos.Row + 1, pos.Col);

            if (ChessBoard.PositionInBounds(front))
            {
                moves.Add(front);
            }

            BoardPosition back = new BoardPosition(pos.Row - 1, pos.Col);

            if (ChessBoard.PositionInBounds(back))
            {
                moves.Add(back);
            }

            //diagonal
            BoardPosition front_left = new BoardPosition(pos.Row + 1, pos.Col - 1);

            if (ChessBoard.PositionInBounds(front_left))
            {
                moves.Add(front_left);
            }
            BoardPosition front_right = new BoardPosition(pos.Row + 1, pos.Col + 1);

            if (ChessBoard.PositionInBounds(front_right))
            {
                moves.Add(front_right);
            }

            BoardPosition back_left = new BoardPosition(pos.Row - 1, pos.Col - 1);

            if (ChessBoard.PositionInBounds(back_left))
            {
                moves.Add(back_left);
            }

            BoardPosition back_right = new BoardPosition(pos.Row - 1, pos.Col + 1);

            if (ChessBoard.PositionInBounds(back_right))
            {
                moves.Add(back_right);
            }


            return(moves);
        }
        public static IEnumerable <BoardPosition> GetRookMoves(BoardPosition pos, ChessBoard board)
        {
            List <BoardPosition> moves = new List <BoardPosition>();
            int row_adder = 1;
            int col_adder = 0;

            for (int i = 0; i < 4; i++)
            {
                if (i == 1)
                {
                    row_adder = -1;
                }
                if (i == 2)
                {
                    row_adder = 0; col_adder = 1;
                }
                if (i == 3)
                {
                    col_adder = -1;
                }
                BoardPosition temp = new BoardPosition(pos.Row + row_adder, pos.Col + col_adder);
                while (ChessBoard.PositionInBounds(temp))
                {
                    moves.Add(temp);
                    if (!board.GetPieceAtPosition(temp).PieceType.Equals(ChessPieceType.Empty))
                    {
                        break;
                    }
                    temp = new BoardPosition(temp.Row + row_adder, temp.Col + col_adder);
                }
            }
            //BoardPosition temp = new BoardPosition(pos.Row + 1, pos.Col);
            //while (ChessBoard.PositionInBounds(temp))
            //{
            //    moves.Add(temp);
            //    if (! board.GetPieceAtPosition(temp).PieceType.Equals(ChessPieceType.Empty))
            //        break;
            //    temp = new BoardPosition(temp.Row+1, temp.Col);
            //}
            ////while loop right
            //temp = new BoardPosition(pos.Row, pos.Col + 1);
            //while (ChessBoard.PositionInBounds(temp))
            //{
            //    moves.Add(temp);
            //    if (!board.GetPieceAtPosition(temp).PieceType.Equals(ChessPieceType.Empty))
            //        break;
            //    temp = new BoardPosition(temp.Row, temp.Col + 1);
            //}
            ////while loop back
            //temp = new BoardPosition(pos.Row - 1, pos.Col);
            //while (ChessBoard.PositionInBounds(temp))
            //{
            //    moves.Add(temp);
            //    if (!board.GetPieceAtPosition(temp).PieceType.Equals(ChessPieceType.Empty))
            //        break;
            //    temp = new BoardPosition(temp.Row - 1, temp.Col);
            //}
            ////while loop left
            //temp = new BoardPosition(pos.Row, pos.Col-1);
            //while (ChessBoard.PositionInBounds(temp))
            //{
            //    moves.Add(temp);
            //    if (!board.GetPieceAtPosition(temp).PieceType.Equals(ChessPieceType.Empty))
            //        break;
            //    temp = new BoardPosition(temp.Row, temp.Col-1);
            //}

            return((IEnumerable <BoardPosition>)moves);
        }
        public static IEnumerable <BoardPosition> GetPawnMoves(BoardPosition pawn_pos, ChessBoard board)
        {
            List <BoardPosition> pawn_moves = new List <BoardPosition>();
            //ChessPiece pawn = board.GetPieceAtPosition(pawn_pos);

            /*
             * //front
             * BoardPosition one_front = new BoardPosition(pawn_pos.Row + 1, pawn_pos.Col);
             * if (ChessBoard.PositionInBounds(one_front))
             *  pawn_moves.Add(one_front);
             */
            //front right
            int player = board.GetPlayerAtPosition(pawn_pos);

            if (player == 1)
            {
                BoardPosition front_right = new BoardPosition(pawn_pos.Row - 1, pawn_pos.Col - 1);
                if (ChessBoard.PositionInBounds(front_right))
                {
                    pawn_moves.Add(front_right);
                }
                //front-left
                BoardPosition one_left = new BoardPosition(pawn_pos.Row - 1, pawn_pos.Col + 1);
                if (ChessBoard.PositionInBounds(one_left))
                {
                    pawn_moves.Add(one_left);
                }

                /*
                 *  if (pawn_pos.Row == 1)
                 * {
                 *  BoardPosition two_front = new BoardPosition(pawn_pos.Row - 2, pawn_pos.Col);
                 *  pawn_moves.Add(two_front);
                 * }
                 */
            }
            else
            {
                BoardPosition front_right = new BoardPosition(pawn_pos.Row + 1, pawn_pos.Col + 1);
                if (ChessBoard.PositionInBounds(front_right))
                {
                    pawn_moves.Add(front_right);
                }
                //front-left
                BoardPosition one_left = new BoardPosition(pawn_pos.Row + 1, pawn_pos.Col - 1);
                if (ChessBoard.PositionInBounds(one_left))
                {
                    pawn_moves.Add(one_left);
                }

                /*
                 *
                 *  if (pawn_pos.Row == 1)
                 * {
                 *  BoardPosition two_front = new BoardPosition(pawn_pos.Row + 2, pawn_pos.Col);
                 *  pawn_moves.Add(two_front);
                 * }
                 */
            }

            return(pawn_moves);
        }