jrummikub.model
Class Table
java.lang.Object
jrummikub.model.StoneTray<StoneSet>
jrummikub.model.Table
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Pair<StoneSet,Position>>, IStoneTray<StoneSet>, ITable
public class Table
- extends StoneTray<StoneSet>
- implements ITable
Class administering the Stone
s on the game-Table
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Iterable |
iterator |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
gameSettings
private GameSettings gameSettings
Table
public Table(GameSettings settings)
- Constructor for a table
- Parameters:
settings
- GameSettings
pickUpStone
public void pickUpStone(Stone stone)
- Removes
Stone
from the Table
- Specified by:
pickUpStone
in interface ITable
- Parameters:
stone
- stone to pick up
findStoneInfo
private Table.StoneInfo findStoneInfo(Stone stone)
- Finds
Table.StoneInfo
- Parameters:
stone
- the stone
- Returns:
- the info
findStoneSet
public StoneSet findStoneSet(Stone stone)
- Description copied from interface:
ITable
- Finds the
StoneSet
containing the given Stone
- Specified by:
findStoneSet
in interface ITable
- Parameters:
stone
- stone whose set we're searching
- Returns:
- the set containing the stone or null if no set was found
splitSet
private void splitSet(StoneSet set,
Position setPosition,
int stonePosition)
- Splits a stone set at a specified position
- Parameters:
set
- the stone set to splitsetPosition
- the set's position on the tablestonePosition
- the stone after which splitting should occur
isValid
public boolean isValid()
- Tests the Table for rule conflicts by checking all the
StoneSet
- Specified by:
isValid
in interface ITable
- Returns:
- whether all sets on the table are valid