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); }
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); }