Esempio n. 1
0
        public bool MoveIsValid(Move move, Board board)
        {
            if (move == null)
            {
                Console.WriteLine("parse failed");
                return false;
            }

            if (!board.IsInBoard(move))
            {
                Console.WriteLine("move not on board");
                return false;
            }
            if (!board.HasFigureForMove(move))
            {
                Console.WriteLine("no figure to move");
                return false;
            }
            if (!MoveIsAllowed(move, board))
            {
                Console.WriteLine("invalid move");
                return false;
            }

            return true;
        }