diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jrummikub/model/GameState.java | 2 | ||||
-rw-r--r-- | src/jrummikub/model/Hand.java | 15 | ||||
-rw-r--r-- | src/jrummikub/model/Player.java | 3 | ||||
-rw-r--r-- | src/jrummikub/model/Position.java | 5 | ||||
-rw-r--r-- | src/jrummikub/model/Stone.java | 4 | ||||
-rw-r--r-- | src/jrummikub/model/StoneColor.java | 1 | ||||
-rw-r--r-- | src/jrummikub/model/StoneSet.java | 15 | ||||
-rw-r--r-- | src/jrummikub/model/Table.java | 31 |
8 files changed, 73 insertions, 3 deletions
diff --git a/src/jrummikub/model/GameState.java b/src/jrummikub/model/GameState.java index 2e5f17b..ce81ece 100644 --- a/src/jrummikub/model/GameState.java +++ b/src/jrummikub/model/GameState.java @@ -1,11 +1,13 @@ package jrummikub.model; +/** Class managing the overall and momentary GameState */ public class GameState { private Table table; private Player[] players; private int activePlayer; private StoneHeap gameHeap; + /** Changes the activePlayer to the next {@link Player} in the list */ public void nextPlayer() { } diff --git a/src/jrummikub/model/Hand.java b/src/jrummikub/model/Hand.java index 91696ab..9437b04 100644 --- a/src/jrummikub/model/Hand.java +++ b/src/jrummikub/model/Hand.java @@ -1,13 +1,28 @@ package jrummikub.model; +/** Class managing a {@link Player}'s {@link Stone}s */ public class Hand { private Stone[] stones; private Position[] position; + /** + * Removes {@link Stone} from Hand and returns it + * + * @param position + * position of {@link Stone} that will be removed + */ public Stone pickUp(Position position) { } + /** + * Adds {@link Stone} to the Hand + * + * @param stone + * {@link Stone} to add to Hand + * @param position + * {@link Position} to put the {@link Stone} + */ public void drop(Stone stone, Position position) { } diff --git a/src/jrummikub/model/Player.java b/src/jrummikub/model/Player.java index 7cc55be..356b844 100644 --- a/src/jrummikub/model/Player.java +++ b/src/jrummikub/model/Player.java @@ -2,9 +2,10 @@ package jrummikub.model; import java.awt.Color; +/** Class managing player data. No methods in release 1 */ public class Player { private Hand hand; - // Könnten wir einfach die Steinfarben vergeben? + private Color color; // private String name; diff --git a/src/jrummikub/model/Position.java b/src/jrummikub/model/Position.java index 5c500eb..5e0198b 100644 --- a/src/jrummikub/model/Position.java +++ b/src/jrummikub/model/Position.java @@ -1,5 +1,10 @@ package jrummikub.model; +/** + * {@link Stone} Position class to determine positions on {@link Table} or + * {@link Hand} + */ + public class Position { private float x; private float y; diff --git a/src/jrummikub/model/Stone.java b/src/jrummikub/model/Stone.java index 47354e5..b9184da 100644 --- a/src/jrummikub/model/Stone.java +++ b/src/jrummikub/model/Stone.java @@ -1,11 +1,11 @@ package jrummikub.model; -/** */ + +/** Basic Rummikub Stone */ public class Stone { private int value; private StoneColor color; private final boolean joker; - public Stone(int value, StoneColor color, boolean joker) { this.value = value; diff --git a/src/jrummikub/model/StoneColor.java b/src/jrummikub/model/StoneColor.java index d627423..a08b38c 100644 --- a/src/jrummikub/model/StoneColor.java +++ b/src/jrummikub/model/StoneColor.java @@ -1,5 +1,6 @@ package jrummikub.model; +/** Class specifing possible StoneColors */ public enum StoneColor { BLACK, ORANGE, BLUE, RED } diff --git a/src/jrummikub/model/StoneSet.java b/src/jrummikub/model/StoneSet.java index 4dd5971..67ad795 100644 --- a/src/jrummikub/model/StoneSet.java +++ b/src/jrummikub/model/StoneSet.java @@ -1,16 +1,31 @@ package jrummikub.model; +/** Class managing {@link Stone}s joined together to form sets */ public class StoneSet { private Stone[] stones; + /** Test for rule conflict within the StoneSet */ public boolean isValid() { } + /** + * Splits the StoneSet at a specified {@link Position} and returns two new + * Stone Sets + * + * @param position + * Splitting {@link Position} + */ public StoneSet[] splitAt(int position) { } + /** + * Joins StoneSet to another StoneSet and returns the resulting new StoneSet + * + * @param other + * StoneSet to be joined to active StoneSet + */ public StoneSet join(StoneSet other) { } diff --git a/src/jrummikub/model/Table.java b/src/jrummikub/model/Table.java index 6a0a826..923a6a1 100644 --- a/src/jrummikub/model/Table.java +++ b/src/jrummikub/model/Table.java @@ -1,5 +1,7 @@ package jrummikub.model; +/** Class administering the {@link Stone}s on the game-Table */ + public class Table { private StoneSet[] sets; private Position[] positions; @@ -7,22 +9,51 @@ public class Table { // Constructor public Table gameTable = new Table(); + /** + * Removes {@link Stone} from the Table and returns it + * + * @param position + * {@link Position} of the selected {@link Stone} + */ public Stone pickUp(Position position) { } + /** + * Removes a {@link StoneSet} from the Table and returns it + * + * @param position + * {@link Position} of the selected {@link StoneSet} + */ public StoneSet pickUpSet(Position position) { } + /** + * Removes a part of a {@link StoneSet} from the Table and returns it + * + * @param from + * Start {@link Position} of the range + * @param to + * End {@link Position} of the range + */ public StoneSet pickUpRange(Position from, Position to) { } + /** + * Adds {@link StoneSet} to Table + * + * @param position + * Specifies {@link Position} to put the {@link StoneSet} + * @param stones + * The {@link StoneSet} to add to the Table + */ public void drop(Position position, StoneSet stones) { } + /** Tests the Table for rule conflicts by checking all the {@link StoneSets} */ public boolean isValid() { } |