summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/TurnControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control/TurnControl.java')
-rw-r--r--src/jrummikub/control/TurnControl.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/jrummikub/control/TurnControl.java b/src/jrummikub/control/TurnControl.java
index 32e6379..ace201e 100644
--- a/src/jrummikub/control/TurnControl.java
+++ b/src/jrummikub/control/TurnControl.java
@@ -21,6 +21,9 @@ import jrummikub.util.IListener2;
import jrummikub.util.Pair;
import jrummikub.view.IView;
+/**
+ * Controller for a single turn made by a human player
+ */
public class TurnControl {
private IHand hand;
private ITable table;
@@ -32,6 +35,17 @@ public class TurnControl {
private Event endOfTurnEvent = new Event();
private List<Connection> connections = new ArrayList<Connection>();
+ /**
+ * Create a new TurnControl using a given hand (of the active player), a
+ * given table and a given view for user interaction.
+ *
+ * @param hand
+ * active player's hand
+ * @param table
+ * current table
+ * @param view
+ * view for user interaction.
+ */
public TurnControl(IHand hand, ITable table, IView view) {
this.hand = hand;
this.table = table;
@@ -47,6 +61,9 @@ public class TurnControl {
this.timer = testTimer;
}
+ /**
+ * Start the turn
+ */
public void startTurn() {
IListener endOfTurnListener = new IListener() {
@@ -408,6 +425,11 @@ public class TurnControl {
view.setSelectedStones(new ArrayList<Stone>());
}
+ /**
+ * Get the event that is emitted when the turn is over
+ *
+ * @return end of turn event
+ */
public IEvent getEndOfTurnEvent() {
return endOfTurnEvent;
}