View Javadoc
1 package net.mlw.gfw.ext.basic.server;
2
3 import net.mlw.gfw.ext.basic.exception.SeatTakenException;
4
5 /*** A <code>Game</code> contains the logic and rules of a game. IT should not
6 * contain any Event(s) of EventHandlers.
7 *
8 * In a MVC, this would be the model.
9 *
10 * @author Matthew L. Wilson
11 * @version $Revision: 1.4 $ $Date: 2004/06/25 20:13:26 $
12 */
13 public interface TurnBasedGame
14 {
15 /*** Gets the number of players needed before a
16 * <code>StartRoundEvent</code> is sent.
17 *
18 * @return The number of seats.
19 */
20 int getNumberOfSeats();
21
22 /*** Gets the number of players currently
23 * seated.
24 *
25 * @return The number of Player(s) seated.
26 */
27 int getNumberSeated();
28
29 /*** Gets the player seated in the given seat.
30 *
31 * @param seat The seat the player is siting in.
32 * @return The player.
33 *
34 * @throws IndexOutOfBoundsException if an invalid seat is passed.
35 */
36 Player getPlayerSeatedAt(int seat);
37
38 /*** Sets a player to a given seat.
39 *
40 * @param player The player.
41 * @param seat The seat the player is siting in.
42 *
43 * @throws IndexOutOfBoundsException if an invalid seat is passed.
44 * @throws SeatTakenException is the seat is already taken.
45 */
46 void setPlayerSeatedAt(Player player, int seat);
47
48 /*** Gets the seat of the current turn.
49 * @return The seat of the current turn.
50 */
51 int getCurrentTurn();
52
53 /*** Sets the seat of the current turn.
54 * @param turn The seat of the current turn.
55 */
56 void setCurrentTurn(int turn);
57
58 /*** Gets the seat of the Player that started this
59 * round.
60 *
61 * @return The seat of the Player that started this
62 * round.
63 */
64 int getLeader();
65 void setLeader(int leader);
66
67 /*** Gets the seat index of the player.
68 *
69 * @param userName
70 * @return
71 */
72 int getSeatOfPlayer(String userName);
73
74 /*** Gets the number of players per team.
75 *
76 * @return The number of players per team.
77 */
78 int getNumberOfPlayersPerTeam();
79 }
This page was automatically generated by Maven