summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/stragegies/reducer/BackwardReducer.java
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-11-24 15:23:36 +0100
committerPacien TRAN-GIRARD2015-11-24 15:37:19 +0100
commit33e497e3083c8446588244c1fa9e69f70af05664 (patch)
tree3ef665e3c9478f196bb6d61dd15a71c0a9919216 /src/ch/epfl/maze/physical/stragegies/reducer/BackwardReducer.java
parent6f2f503bbf75901273376c8c009a6b96886650c8 (diff)
downloadmaze-solver-33e497e3083c8446588244c1fa9e69f70af05664.tar.gz
Refactor Mouse strategy
Diffstat (limited to 'src/ch/epfl/maze/physical/stragegies/reducer/BackwardReducer.java')
-rw-r--r--src/ch/epfl/maze/physical/stragegies/reducer/BackwardReducer.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ch/epfl/maze/physical/stragegies/reducer/BackwardReducer.java b/src/ch/epfl/maze/physical/stragegies/reducer/BackwardReducer.java
new file mode 100644
index 0000000..4ef2ff8
--- /dev/null
+++ b/src/ch/epfl/maze/physical/stragegies/reducer/BackwardReducer.java
@@ -0,0 +1,22 @@
1package ch.epfl.maze.physical.stragegies.reducer;
2
3import ch.epfl.maze.util.Direction;
4
5import java.util.Set;
6
7/**
8 * A filter removing the possibility to go backward.
9 *
10 * @author Pacien TRAN-GIRARD
11 */
12public interface BackwardReducer extends BlindChoiceReducer {
13
14 Direction getDirection();
15
16 @Override
17 default Set<Direction> reduce(Set<Direction> choices) {
18 choices.remove(this.getDirection().reverse());
19 return choices;
20 }
21
22}