Esempio n. 1
0
        public override List <IPosition> GetPossibleMoves(IPosition oPosition, IChessTable chessTable)
        {
            List <IPosition> possibleMoves = new List <IPosition>();

            foreach (var aMove in moves)
            {
                IPosition nextPosition = aMove.GetMove(oPosition);
                if (chessTable.IsValidPosition(nextPosition))
                {
                    possibleMoves.Add(nextPosition);
                    nextPosition = aMove.GetMove(nextPosition);
                    if (_isFirstMove && chessTable.IsValidPosition(nextPosition))
                    {
                        possibleMoves.Add(nextPosition);
                    }
                }
            }

            return(possibleMoves);
        }
Esempio n. 2
0
        public override List <IPosition> GetPossibleMoves(IPosition oPosition, IChessTable chessTable)
        {
            List <IPosition> possibleMoves = new List <IPosition>();

            foreach (var aMove in moves)
            {
                if (chessTable.IsValidPosition(aMove.GetMove(oPosition)))
                {
                    possibleMoves.Add(aMove.GetMove(oPosition));
                }
            }

            return(possibleMoves);
        }
Esempio n. 3
0
        public override List <IPosition> GetPossibleMoves(IPosition oPosition, IChessTable chessTable)
        {
            List <IPosition> possibleMoves = new List <IPosition>();

            foreach (IMove aBasicMove in moves)
            {
                IPosition nextPosition = aBasicMove.GetMove(oPosition);
                while (chessTable.IsValidPosition(nextPosition))
                {
                    possibleMoves.Add(nextPosition);
                    nextPosition = aBasicMove.GetMove(nextPosition);
                }
            }
            return(possibleMoves);
        }