rolec
Class Players

java.lang.Object
  extended by rolec.Players

public class Players
extends java.lang.Object

This class represents the group of players in a game of Frank's Zoo


Constructor Summary
Players(int p)
          Constructs a new group of Players
Players(int p, int[] o)
          Constructs a new group of Players that take turns in a specific order
 
Method Summary
 void addPlayer(Player p)
          Adds a player to the group of players
 Player first()
          Returns the player who starts
 int[] getOrder()
          Returns the order in which players take turns
 Player next(Player p)
          Returns the player next to a specific player
 Player player(int i)
          Returns a specific Player
 int size()
          Returns the number of players
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Players

public Players(int p)
Constructs a new group of Players


Players

public Players(int p,
               int[] o)
Constructs a new group of Players that take turns in a specific order

Parameters:
p - the number of players
o - the order in which the players take turns
Method Detail

player

public Player player(int i)
Returns a specific Player

Parameters:
i - the ID of the player to be returned
Returns:
the player with the specified ID

addPlayer

public void addPlayer(Player p)
Adds a player to the group of players

Parameters:
p - the player to be added

size

public int size()
Returns the number of players

Returns:
the number of players

next

public Player next(Player p)
Returns the player next to a specific player

Returns:
the player next to the specified player

first

public Player first()
Returns the player who starts

Returns:
the player who starts

getOrder

public int[] getOrder()
Returns the order in which players take turns

Returns:
an array indicating the order in which players take turns (e.g., order[i] contains the ID of the ith player)