From 74d8205f30732a8afd6aa45f859188b0a3d447e5 Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Mon, 20 Jun 2011 04:39:54 +0200 Subject: Kommentare, Kommentare git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@509 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/GameSettings.java | 5 +++++ src/jrummikub/model/IPlayer.java | 26 ++++++++++++++++++++++++-- src/jrummikub/model/IStoneTray.java | 17 ++++++++++++----- 3 files changed, 41 insertions(+), 7 deletions(-) (limited to 'src/jrummikub/model') diff --git a/src/jrummikub/model/GameSettings.java b/src/jrummikub/model/GameSettings.java index 55419a4..dfd391e 100644 --- a/src/jrummikub/model/GameSettings.java +++ b/src/jrummikub/model/GameSettings.java @@ -248,6 +248,11 @@ public class GameSettings implements Serializable { } + /** + * Calculate the total number of stones in game + * + * @return total number of stones + */ public int getTotalStones() { return getHighestValue() * getStoneSetNumber() * getStoneColors().size() + getJokerNumber(); diff --git a/src/jrummikub/model/IPlayer.java b/src/jrummikub/model/IPlayer.java index a72b002..a88d838 100644 --- a/src/jrummikub/model/IPlayer.java +++ b/src/jrummikub/model/IPlayer.java @@ -18,7 +18,7 @@ public interface IPlayer extends Serializable { * Set the current hand of the player * * @param hand - * the new hand + * the new hand */ public void setHand(IHand hand); @@ -40,16 +40,38 @@ public interface IPlayer extends Serializable { * Set if the player laid out * * @param laidOut - * the player laid out + * the player laid out * */ public void setLaidOut(boolean laidOut); + /** + * Getter for last turn invalid + * + * @return last turn invalid + */ public boolean wasLastTurnInvalid(); + /** + * Sets last turn invalid + * + * @param value + * last turn invalid + */ public void setLastTurnInvalid(boolean value); + /** + * Gets the number of stones put on table in player's last turn + * + * @return number of stones + */ public int getLastTurnStoneCount(); + /** + * Sets the number of stones out on the table in player's last turn + * + * @param value + * number of stones + */ public void setLastTurnStoneCount(int value); } \ No newline at end of file diff --git a/src/jrummikub/model/IStoneTray.java b/src/jrummikub/model/IStoneTray.java index 437ecda..17e7ae3 100644 --- a/src/jrummikub/model/IStoneTray.java +++ b/src/jrummikub/model/IStoneTray.java @@ -8,7 +8,7 @@ import jrummikub.util.Pair; * Interface for the {@link StoneTray} model * * @param - * Objects held by the IStoneTray + * Objects held by the IStoneTray */ public interface IStoneTray extends Iterable>, Cloneable, Serializable { @@ -17,9 +17,9 @@ public interface IStoneTray extends * Adds object to the tray * * @param object - * object to add to Hand + * object to add to Hand * @param position - * {@link Position} to put the object + * {@link Position} to put the object */ public void drop(E object, Position position); @@ -27,7 +27,7 @@ public interface IStoneTray extends * Returns the position of an object that is already on the tray * * @param object - * object whose position is requested + * object whose position is requested * @return position of the object or null when the object is not on the tray */ public Position getPosition(E object); @@ -36,7 +36,7 @@ public interface IStoneTray extends * Tries to pick up (remove) a given object * * @param object - * object to pick up + * object to pick up * @return true when the object was successfully removed */ public boolean pickUp(E object); @@ -55,6 +55,13 @@ public interface IStoneTray extends */ public int getSize(); + /** + * Search for an object within the stone tray + * + * @param object + * object to search for + * @return object found in stone tray + */ public boolean contains(E object); } \ No newline at end of file -- cgit v1.2.3