Ejemplo n.º 1
0
        public static bool AreThereLegalMoves(int roll, Gamestate state)
        {
            List <Piece> activePlayerPieces = PlayerFunctions.GetActivePlayersPieces(state);

            foreach (Piece p in activePlayerPieces)
            {
                if (CheckIfPieceCanMove(roll, p, state))
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
        public static List <int> ListLegalMoves(int roll, Gamestate state)
        {
            List <Piece> pieces             = PlayerFunctions.GetActivePlayersPieces(state);
            List <int>   listOfMoveablesIds = new();

            foreach (Piece p in pieces)
            {
                if (CheckIfPieceCanMove(roll, p, state))
                {
                    listOfMoveablesIds.Add(p.HiddenID);
                }
            }
            return(listOfMoveablesIds);
        }