summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/stragegies
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-11-24 16:59:05 +0100
committerPacien TRAN-GIRARD2015-11-24 16:59:05 +0100
commit96932b453e3f2fa1cfb45e79aca49e72d7b8d10f (patch)
treee9aef469ceabcc118966ab89953a51ea0132b81f /src/ch/epfl/maze/physical/stragegies
parent3f5c3d91a084233cfc77635697b3c537adbced74 (diff)
downloadmaze-solver-96932b453e3f2fa1cfb45e79aca49e72d7b8d10f.tar.gz
Update Monkey A.I. for open positions
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}