<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_22) on Tue Jul 05 21:51:54 CEST 2011 --> <TITLE> RoundControl </TITLE> <META NAME="date" CONTENT="2011-07-05"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="RoundControl"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RoundControl.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../jrummikub/control/LoginControl.html" title="class in jrummikub.control"><B>PREV CLASS</B></A> <A HREF="../../jrummikub/control/RoundControl.InvalidTurnInfo.html" title="class in jrummikub.control"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?jrummikub/control/RoundControl.html" target="_top"><B>FRAMES</B></A> <A HREF="RoundControl.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> jrummikub.control</FONT> <BR> Class RoundControl</H2> <PRE> java.lang.Object <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>jrummikub.control.RoundControl</B> </PRE> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../jrummikub/control/network/NetworkRoundControl.html" title="class in jrummikub.control.network">NetworkRoundControl</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>RoundControl</B><DT>extends java.lang.Object</DL> </PRE> <P> Controller that manages a single round of rummikub <P> <P> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <A NAME="nested_class_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Nested Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.InvalidTurnInfo.html" title="class in jrummikub.control">RoundControl.InvalidTurnInfo</A></B></CODE> <BR> Table, stone sets and type of an invalid turn to allow a user to track his own errors</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.InvalidTurnType.html" title="enum in jrummikub.control">RoundControl.InvalidTurnType</A></B></CODE> <BR> Enum summarizing the different types of invalid turns to set the correct panel message</TD> </TR> </TABLE> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected java.util.List<<A HREF="../../jrummikub/util/Connection.html" title="interface in jrummikub.util">Connection</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#connections">connections</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private <A HREF="../../jrummikub/util/Event1.html" title="class in jrummikub.util">Event1</A><<A HREF="../../jrummikub/model/Score.html" title="class in jrummikub.model">Score</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#endOfRoundEvent">endOfRoundEvent</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#mayPause">mayPause</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private <A HREF="../../jrummikub/util/Event1.html" title="class in jrummikub.util">Event1</A><<A HREF="../../jrummikub/model/PlayerSettings.html" title="class in jrummikub.model">PlayerSettings</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#restartRoundEvent">restartRoundEvent</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#roundState">roundState</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private <A HREF="../../jrummikub/util/Event1.html" title="class in jrummikub.util">Event1</A><<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#roundStateUpdateEvent">roundStateUpdateEvent</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private <A HREF="../../jrummikub/control/turn/ITurnControl.html" title="interface in jrummikub.control.turn">ITurnControl</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#turnControl">turnControl</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private <A HREF="../../jrummikub/view/IView.html" title="interface in jrummikub.view">IView</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#view">view</A></B></CODE> <BR> </TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#RoundControl(jrummikub.model.IRoundState, jrummikub.view.IView)">RoundControl</A></B>(<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A> roundState, <A HREF="../../jrummikub/view/IView.html" title="interface in jrummikub.view">IView</A> view)</CODE> <BR> Create a new RoundControl using the given roundState and view</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected </CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#RoundControl(jrummikub.model.IRoundState, jrummikub.view.IView, boolean)">RoundControl</A></B>(<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A> roundState, <A HREF="../../jrummikub/view/IView.html" title="interface in jrummikub.view">IView</A> view, boolean mayPause)</CODE> <BR> Create a new RoundControl using the given roundState and view</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#abortRound()">abortRound</A></B>()</CODE> <BR> Abort round if a new one is started or a saved one is loaded</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#addTurnControlListeners(jrummikub.control.turn.ITurnControl)">addTurnControlListeners</A></B>(<A HREF="../../jrummikub/control/turn/ITurnControl.html" title="interface in jrummikub.control.turn">ITurnControl</A> turnControl)</CODE> <BR> Override this</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#continueRound()">continueRound</A></B>()</CODE> <BR> Continue a saved round after loading</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../jrummikub/control/turn/ITurnControl.html" title="interface in jrummikub.control.turn">ITurnControl</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#createTurnControl()">createTurnControl</A></B>()</CODE> <BR> Creates new turn control of the specified type</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#deal()">deal</A></B>()</CODE> <BR> Deal each player the number of stones specified in the game settings (numberOfStonesDealt)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#doPrepareTurn()">doPrepareTurn</A></B>()</CODE> <BR> Prepare turn by setting the view components</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>(package private) void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#endOfRound()">endOfRound</A></B>()</CODE> <BR> Ends the current round and emits an event setting the score</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#endOfTurn(jrummikub.control.RoundControl.InvalidTurnInfo)">endOfTurn</A></B>(<A HREF="../../jrummikub/control/RoundControl.InvalidTurnInfo.html" title="class in jrummikub.control">RoundControl.InvalidTurnInfo</A> invalidTurnInfo)</CODE> <BR> End the players turn</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../jrummikub/util/IEvent1.html" title="interface in jrummikub.util">IEvent1</A><<A HREF="../../jrummikub/model/Score.html" title="class in jrummikub.model">Score</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#getEndOfRoundEvent()">getEndOfRoundEvent</A></B>()</CODE> <BR> End the round</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../jrummikub/util/IEvent1.html" title="interface in jrummikub.util">IEvent1</A><<A HREF="../../jrummikub/model/PlayerSettings.html" title="class in jrummikub.model">PlayerSettings</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#getRestartRoundEvent()">getRestartRoundEvent</A></B>()</CODE> <BR> Emitted when the round is aborted and needs to be restarted</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../jrummikub/util/IEvent1.html" title="interface in jrummikub.util">IEvent1</A><<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#getRoundStateUpdateEvent()">getRoundStateUpdateEvent</A></B>()</CODE> <BR> Is emitted in network when a new turn starts</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#nextPlayer()">nextPlayer</A></B>()</CODE> <BR> Set the next player as active player if the round is not finished</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#prepareTurn()">prepareTurn</A></B>()</CODE> <BR> Prepare a player's turn by checking the player types and setting the correct turn control</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#redeal()">redeal</A></B>()</CODE> <BR> Redeal stones and restart round if a player was allowed to redeal and chose to do so</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#removeListeners()">removeListeners</A></B>()</CODE> <BR> Removes all listeners form the connections</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private <A HREF="../../jrummikub/model/Score.html" title="class in jrummikub.model">Score</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#score()">score</A></B>()</CODE> <BR> Calculate the score for the current round and the total game score</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#setRoundState(jrummikub.model.IRoundState)">setRoundState</A></B>(<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A> state)</CODE> <BR> Sets the current round state</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../jrummikub/view/IView.BottomPanelType.html" title="enum in jrummikub.view">IView.BottomPanelType</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#showStartTurnPanel()">showStartTurnPanel</A></B>()</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#startRound()">startRound</A></B>()</CODE> <BR> Begin the round</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#startTurn()">startTurn</A></B>()</CODE> <BR> Start a players turn with the correct turn control</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private static <A HREF="../../jrummikub/util/Pair.html" title="class in jrummikub.util">Pair</A><java.lang.Integer,java.lang.Integer></CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#updateBestScore(jrummikub.util.Pair, int, int)">updateBestScore</A></B>(<A HREF="../../jrummikub/util/Pair.html" title="class in jrummikub.util">Pair</A><java.lang.Integer,java.lang.Integer> bestScore, int stonePoints, int size)</CODE> <BR> Update the best score to find the winner in case of special game end (everybody still has stones on hand)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../jrummikub/control/RoundControl.html#updateSidePanel()">updateSidePanel</A></B>()</CODE> <BR> Update the side panel to show correct player order and heap size</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="turnControl"><!-- --></A><H3> turnControl</H3> <PRE> private <A HREF="../../jrummikub/control/turn/ITurnControl.html" title="interface in jrummikub.control.turn">ITurnControl</A> <B>turnControl</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="roundState"><!-- --></A><H3> roundState</H3> <PRE> protected <A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A> <B>roundState</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="view"><!-- --></A><H3> view</H3> <PRE> private <A HREF="../../jrummikub/view/IView.html" title="interface in jrummikub.view">IView</A> <B>view</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="restartRoundEvent"><!-- --></A><H3> restartRoundEvent</H3> <PRE> private <A HREF="../../jrummikub/util/Event1.html" title="class in jrummikub.util">Event1</A><<A HREF="../../jrummikub/model/PlayerSettings.html" title="class in jrummikub.model">PlayerSettings</A>> <B>restartRoundEvent</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="roundStateUpdateEvent"><!-- --></A><H3> roundStateUpdateEvent</H3> <PRE> private <A HREF="../../jrummikub/util/Event1.html" title="class in jrummikub.util">Event1</A><<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A>> <B>roundStateUpdateEvent</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="endOfRoundEvent"><!-- --></A><H3> endOfRoundEvent</H3> <PRE> private <A HREF="../../jrummikub/util/Event1.html" title="class in jrummikub.util">Event1</A><<A HREF="../../jrummikub/model/Score.html" title="class in jrummikub.model">Score</A>> <B>endOfRoundEvent</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="connections"><!-- --></A><H3> connections</H3> <PRE> protected java.util.List<<A HREF="../../jrummikub/util/Connection.html" title="interface in jrummikub.util">Connection</A>> <B>connections</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="mayPause"><!-- --></A><H3> mayPause</H3> <PRE> private boolean <B>mayPause</B></PRE> <DL> <DL> </DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="RoundControl(jrummikub.model.IRoundState, jrummikub.view.IView)"><!-- --></A><H3> RoundControl</H3> <PRE> public <B>RoundControl</B>(<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A> roundState, <A HREF="../../jrummikub/view/IView.html" title="interface in jrummikub.view">IView</A> view)</PRE> <DL> <DD>Create a new RoundControl using the given roundState and view <P> <DL> <DT><B>Parameters:</B><DD><CODE>roundState</CODE> - initial round state<DD><CODE>view</CODE> - view used for user interaction</DL> </DL> <HR> <A NAME="RoundControl(jrummikub.model.IRoundState, jrummikub.view.IView, boolean)"><!-- --></A><H3> RoundControl</H3> <PRE> protected <B>RoundControl</B>(<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A> roundState, <A HREF="../../jrummikub/view/IView.html" title="interface in jrummikub.view">IView</A> view, boolean mayPause)</PRE> <DL> <DD>Create a new RoundControl using the given roundState and view <P> <DL> <DT><B>Parameters:</B><DD><CODE>roundState</CODE> - initial round state<DD><CODE>view</CODE> - view used for user interaction<DD><CODE>mayPause</CODE> - true when players are allowed to pause</DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getRoundStateUpdateEvent()"><!-- --></A><H3> getRoundStateUpdateEvent</H3> <PRE> public <A HREF="../../jrummikub/util/IEvent1.html" title="interface in jrummikub.util">IEvent1</A><<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A>> <B>getRoundStateUpdateEvent</B>()</PRE> <DL> <DD>Is emitted in network when a new turn starts <P> <DD><DL> <DT><B>Returns:</B><DD>the event</DL> </DD> </DL> <HR> <A NAME="getEndOfRoundEvent()"><!-- --></A><H3> getEndOfRoundEvent</H3> <PRE> public <A HREF="../../jrummikub/util/IEvent1.html" title="interface in jrummikub.util">IEvent1</A><<A HREF="../../jrummikub/model/Score.html" title="class in jrummikub.model">Score</A>> <B>getEndOfRoundEvent</B>()</PRE> <DL> <DD>End the round <P> <DD><DL> <DT><B>Returns:</B><DD>endOfRoundEvent</DL> </DD> </DL> <HR> <A NAME="startRound()"><!-- --></A><H3> startRound</H3> <PRE> public void <B>startRound</B>()</PRE> <DL> <DD>Begin the round <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="continueRound()"><!-- --></A><H3> continueRound</H3> <PRE> public void <B>continueRound</B>()</PRE> <DL> <DD>Continue a saved round after loading <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="abortRound()"><!-- --></A><H3> abortRound</H3> <PRE> public void <B>abortRound</B>()</PRE> <DL> <DD>Abort round if a new one is started or a saved one is loaded <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setRoundState(jrummikub.model.IRoundState)"><!-- --></A><H3> setRoundState</H3> <PRE> protected void <B>setRoundState</B>(<A HREF="../../jrummikub/model/IRoundState.html" title="interface in jrummikub.model">IRoundState</A> state)</PRE> <DL> <DD>Sets the current round state <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>state</CODE> - to be set</DL> </DD> </DL> <HR> <A NAME="showStartTurnPanel()"><!-- --></A><H3> showStartTurnPanel</H3> <PRE> protected <A HREF="../../jrummikub/view/IView.BottomPanelType.html" title="enum in jrummikub.view">IView.BottomPanelType</A> <B>showStartTurnPanel</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="prepareTurn()"><!-- --></A><H3> prepareTurn</H3> <PRE> protected void <B>prepareTurn</B>()</PRE> <DL> <DD>Prepare a player's turn by checking the player types and setting the correct turn control <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="doPrepareTurn()"><!-- --></A><H3> doPrepareTurn</H3> <PRE> protected void <B>doPrepareTurn</B>()</PRE> <DL> <DD>Prepare turn by setting the view components <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="startTurn()"><!-- --></A><H3> startTurn</H3> <PRE> protected void <B>startTurn</B>()</PRE> <DL> <DD>Start a players turn with the correct turn control <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="updateSidePanel()"><!-- --></A><H3> updateSidePanel</H3> <PRE> private void <B>updateSidePanel</B>()</PRE> <DL> <DD>Update the side panel to show correct player order and heap size <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="addTurnControlListeners(jrummikub.control.turn.ITurnControl)"><!-- --></A><H3> addTurnControlListeners</H3> <PRE> protected void <B>addTurnControlListeners</B>(<A HREF="../../jrummikub/control/turn/ITurnControl.html" title="interface in jrummikub.control.turn">ITurnControl</A> turnControl)</PRE> <DL> <DD>Override this <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>turnControl</CODE> - current turn control</DL> </DD> </DL> <HR> <A NAME="createTurnControl()"><!-- --></A><H3> createTurnControl</H3> <PRE> protected <A HREF="../../jrummikub/control/turn/ITurnControl.html" title="interface in jrummikub.control.turn">ITurnControl</A> <B>createTurnControl</B>()</PRE> <DL> <DD>Creates new turn control of the specified type <P> <DD><DL> <DT><B>Returns:</B><DD>the new turn control</DL> </DD> </DL> <HR> <A NAME="deal()"><!-- --></A><H3> deal</H3> <PRE> protected void <B>deal</B>()</PRE> <DL> <DD>Deal each player the number of stones specified in the game settings (numberOfStonesDealt) <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="endOfTurn(jrummikub.control.RoundControl.InvalidTurnInfo)"><!-- --></A><H3> endOfTurn</H3> <PRE> protected void <B>endOfTurn</B>(<A HREF="../../jrummikub/control/RoundControl.InvalidTurnInfo.html" title="class in jrummikub.control">RoundControl.InvalidTurnInfo</A> invalidTurnInfo)</PRE> <DL> <DD>End the players turn <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>invalidTurnInfo</CODE> - info about the player's last turn</DL> </DD> </DL> <HR> <A NAME="nextPlayer()"><!-- --></A><H3> nextPlayer</H3> <PRE> protected void <B>nextPlayer</B>()</PRE> <DL> <DD>Set the next player as active player if the round is not finished <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="endOfRound()"><!-- --></A><H3> endOfRound</H3> <PRE> void <B>endOfRound</B>()</PRE> <DL> <DD>Ends the current round and emits an event setting the score <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="removeListeners()"><!-- --></A><H3> removeListeners</H3> <PRE> private void <B>removeListeners</B>()</PRE> <DL> <DD>Removes all listeners form the connections <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="score()"><!-- --></A><H3> score</H3> <PRE> private <A HREF="../../jrummikub/model/Score.html" title="class in jrummikub.model">Score</A> <B>score</B>()</PRE> <DL> <DD>Calculate the score for the current round and the total game score <P> <DD><DL> <DT><B>Returns:</B><DD>the new score</DL> </DD> </DL> <HR> <A NAME="updateBestScore(jrummikub.util.Pair, int, int)"><!-- --></A><H3> updateBestScore</H3> <PRE> private static <A HREF="../../jrummikub/util/Pair.html" title="class in jrummikub.util">Pair</A><java.lang.Integer,java.lang.Integer> <B>updateBestScore</B>(<A HREF="../../jrummikub/util/Pair.html" title="class in jrummikub.util">Pair</A><java.lang.Integer,java.lang.Integer> bestScore, int stonePoints, int size)</PRE> <DL> <DD>Update the best score to find the winner in case of special game end (everybody still has stones on hand) <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>bestScore</CODE> - of previous rounds<DD><CODE>stonePoints</CODE> - sum of points still left on hands<DD><CODE>size</CODE> - number of players in game (= size of score list in columns) <DT><B>Returns:</B><DD>Pair of maximum points and hand size</DL> </DD> </DL> <HR> <A NAME="getRestartRoundEvent()"><!-- --></A><H3> getRestartRoundEvent</H3> <PRE> public <A HREF="../../jrummikub/util/IEvent1.html" title="interface in jrummikub.util">IEvent1</A><<A HREF="../../jrummikub/model/PlayerSettings.html" title="class in jrummikub.model">PlayerSettings</A>> <B>getRestartRoundEvent</B>()</PRE> <DL> <DD>Emitted when the round is aborted and needs to be restarted <P> <DD><DL> <DT><B>Returns:</B><DD>the event</DL> </DD> </DL> <HR> <A NAME="redeal()"><!-- --></A><H3> redeal</H3> <PRE> protected void <B>redeal</B>()</PRE> <DL> <DD>Redeal stones and restart round if a player was allowed to redeal and chose to do so <P> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RoundControl.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../jrummikub/control/LoginControl.html" title="class in jrummikub.control"><B>PREV CLASS</B></A> <A HREF="../../jrummikub/control/RoundControl.InvalidTurnInfo.html" title="class in jrummikub.control"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?jrummikub/control/RoundControl.html" target="_top"><B>FRAMES</B></A> <A HREF="RoundControl.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>