summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/stragegies
diff options
context:
space:
mode:
Diffstat (limited to 'src/ch/epfl/maze/physical/stragegies')
-rw-r--r--src/ch/epfl/maze/physical/stragegies/picker/ForwardPicker.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ch/epfl/maze/physical/stragegies/picker/ForwardPicker.java b/src/ch/epfl/maze/physical/stragegies/picker/ForwardPicker.java
new file mode 100644
index 0000000..b7a44f8
--- /dev/null
+++ b/src/ch/epfl/maze/physical/stragegies/picker/ForwardPicker.java
@@ -0,0 +1,29 @@
1package ch.epfl.maze.physical.stragegies.picker;
2
3import ch.epfl.maze.util.Direction;
4
5import java.util.Set;
6
7/**
8 * A simple decision maker that continues forward if possible.
9 *
10 * @author Pacien TRAN-GIRARD
11 */
12public interface ForwardPicker extends BlindPicker {
13
14 /**
15 * Returns the current Direction the decision maker is walking toward.
16 *
17 * @return The current Direction
18 */
19 Direction getDirection();
20
21 @Override
22 default Direction pick(Set<Direction> choices) {
23 if (choices.contains(this.getDirection()))
24 return this.getDirection();
25 else
26 return FALLBACK_DIRECTION;
27 }
28
29}