summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/java1/aufgabe07/Spieler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/fhswf/in/inf/java1/aufgabe07/Spieler.java')
-rw-r--r--src/de/fhswf/in/inf/java1/aufgabe07/Spieler.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/de/fhswf/in/inf/java1/aufgabe07/Spieler.java b/src/de/fhswf/in/inf/java1/aufgabe07/Spieler.java
new file mode 100644
index 0000000..14d17a8
--- /dev/null
+++ b/src/de/fhswf/in/inf/java1/aufgabe07/Spieler.java
@@ -0,0 +1,47 @@
+/**
+ *
+ */
+package de.fhswf.in.inf.java1.aufgabe07;
+
+/**
+ * Represents a player that chooses a shell.
+ *
+ * @author $Author: $
+ * @version $Revision: $, $Date: $ UTC
+ */
+public abstract class Spieler
+{
+
+ private int ersterTipp = -1;
+
+ /**
+ * The first shell the player chooses.
+ *
+ * @return The first guess for a shell
+ */
+ public final int ersterTipp()
+ {
+ ersterTipp = Spiel.RAND.nextInt(Spiel.MAXHUET);
+ return ersterTipp;
+ }
+
+ /**
+ * Getter for the first choice.
+ *
+ * @return The first choice
+ */
+ public final int getErsterTipp()
+ {
+ return ersterTipp;
+ }
+
+ /**
+ * After the first guess, the player must choose a second shell.
+ *
+ * @param leeresHuetchen
+ * The shell, the game showed as empty
+ * @return The second guess for the right shell
+ */
+ public abstract int zweiterTipp(int leeresHuetchen);
+
+}