Пример #1
0
        public List <List <int> > AllPlayerMoves(GameBoard board, int playerColor)
        {
            List <List <int> >       allPossibleMoves = new List <List <int> >(100);
            List <Tuple <int, int> > allPieces        = board.AllPlayerPieces(playerColor);

            foreach (Tuple <int, int> piece in allPieces)
            {
                int row = piece.Item1;
                int col = piece.Item2;
                List <List <int> > piecePossibleMoves = Rules.PosibleMoves(piece.Item1, piece.Item2, board);
                foreach (List <int> move in piecePossibleMoves)
                {
                    allPossibleMoves.Add(move);
                }
            }

            return(allPossibleMoves);
        }