summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/java1/aufgabe07/Spieler.java
blob: 14d17a8a39828e7e32880cc5b53157965b78b30d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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);

}