summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model/IRoundState.java
blob: 1ac0ac23511b37b5fa36650792539abe05a37756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package jrummikub.model;

import java.io.Serializable;

/**
 * Interface for {@link RoundState} model
 */
public interface IRoundState extends Serializable {

	/**
	 * Get the current {@link GameSettings}
	 * 
	 * @return The game settings
	 */
	public GameSettings getGameSettings();

	/**
	 * Get the current {@link Table}
	 * 
	 * @return The current Table
	 */
	public ITable getTable();

	/**
	 * Sets the current {@link Table}
	 * 
	 * @param table
	 *          The new Table
	 */
	public void setTable(ITable table);

	/**
	 * Returns the number of players
	 * 
	 * @return number of players
	 */
	public int getPlayerCount();

	/** Changes the activePlayer to the next {@link Player} in the list */
	public void nextPlayer();

	/**
	 * Returns the currently active player
	 * 
	 * @return currently active player
	 */
	public IPlayer getActivePlayer();

	/**
	 * Returns the heap of stones to draw from
	 * 
	 * @return heap of stones
	 */
	public StoneHeap getGameHeap();

	/**
	 * Returns the player that would be the active player after i turns
	 * 
	 * @param i
	 *          number of turns
	 * @return player active after i turns
	 */
	public IPlayer getNthNextPlayer(int i);

	/**
	 * Returns the nth player
	 * 
	 * @param i
	 *          player number
	 * @return nth player
	 */
	public IPlayer getNthPlayer(int i);

	/**
	 * Sets the player that will make the last turn before the round ends when the
	 * heap is empty
	 * 
	 * @return the last player
	 */
	public abstract IPlayer getLastPlayer();

	/**
	 * Gets the player that will make the last turn before the round ends when the
	 * heap is empty
	 * 
	 * @param lastPlayer
	 *          the last player
	 */
	public abstract void setLastPlayer(IPlayer lastPlayer);

	/**
	 * Makes the player with number i the active player
	 * 
	 * @param i
	 *          number of the player to make active
	 */
	public void setActivePlayerNumber(int i);

	public GameState getGameState();

	/**
	 * Gets the number of the current turn. Numbers smaller than one indicate hand
	 * inspection turns
	 * 
	 * @return current turn number
	 */
	public int getTurnNumber();

	/**
	 * Increments the turn number
	 * 
	 */
	public void nextTurn();

}