1 package net.sourceforge.simplegamenet.dice;
2
3 import java.io.Serializable;
4
5 /***
6 * This class has the value of a dice and knows whether the dice has been held or not.
7 */
8 public class DiceSingle implements Serializable {
9
10 private boolean diceHeld;
11 private int diceValue;
12
13 /***
14 * Initialises an instance of DiceSingle with a certain value for the dice
15 *
16 * @param diceValue The value of the dice.
17 */
18 public DiceSingle(int diceValue) {
19 this.diceValue = diceValue;
20 }
21
22 /***
23 * Sets whether the dice has been held or not.
24 *
25 * @param holdDice A boolean that tells if the dice is held.
26 */
27 public void setDiceHeld(boolean holdDice) {
28 this.diceHeld = holdDice;
29 }
30
31 /***
32 * Checks if the dice has been held.
33 *
34 * @return Returns true if the dice is held.
35 */
36 public boolean isDiceHeld() {
37 return this.diceHeld;
38 }
39
40 /***
41 * Gets the value of the dice.
42 *
43 * @return Returns an int with the value of the dice.
44 */
45 public int getDiceValue() {
46 return diceValue;
47 }
48
49 /***
50 * Sets the value of the dice.
51 *
52 * @param diceValue The value of the dice.
53 */
54 public void setDiceValue(int diceValue) {
55 this.diceValue = diceValue;
56 }
57
58 }