blob: 4ef2ff8cc9954fd9641a55aa3b84147214403df1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package ch.epfl.maze.physical.stragegies.reducer;
import ch.epfl.maze.util.Direction;
import java.util.Set;
/**
* A filter removing the possibility to go backward.
*
* @author Pacien TRAN-GIRARD
*/
public interface BackwardReducer extends BlindChoiceReducer {
Direction getDirection();
@Override
default Set<Direction> reduce(Set<Direction> choices) {
choices.remove(this.getDirection().reverse());
return choices;
}
}
|