summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/TurnControl.java
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-10 03:54:48 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-10 03:54:48 +0200
commit3b49b2053e9f9d26b73db0ffc8380a60706ee095 (patch)
tree9678d5abb4af070bbf0fd89c684e91f5fd472c31 /src/jrummikub/control/TurnControl.java
parent4a860e53cf6f2f97f18785673399498609e6504b (diff)
downloadJRummikub-3b49b2053e9f9d26b73db0ffc8380a60706ee095.tar
JRummikub-3b49b2053e9f9d26b73db0ffc8380a60706ee095.zip
Added all missing comments
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@213 72836036-5685-4462-b002-a69064685172
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;
}