*/
private Set<ResistenciaCasella> movimentsOrdenats( EstatCasella fitxa_jugador )
{
Set<ResistenciaCasella> moviments_ordenats = new TreeSet<ResistenciaCasella>();
TwoDistance two_distance = two_distance_a;
if ( fitxa_jugador == EstatCasella.JUGADOR_B )
{
two_distance = two_distance_b;
}
if ( two_distance == null )
{
two_distance = new TwoDistance( tauler, fitxa_jugador );
}
int[][] potencials = two_distance.getPotencials();
for ( int fila = 0; fila < tauler.getMida(); fila++ )
{
for ( int columna = 0; columna < tauler.getMida(); columna++ )
{
Casella casella = new Casella( fila, columna );
if ( tauler.esMovimentValid( fitxa_jugador, casella ) )
{
int potencial_moviment = potencials[fila][columna];
if ( potencial_moviment == 0 )
{
potencial_moviment -= two_distance.getPotencialMinim( casella );
}
moviments_ordenats.add( new ResistenciaCasella( casella, potencial_moviment ) );
}
}
}