fi.utu.cs.hockey
Class Team

java.lang.Object
  |
  +--fi.utu.cs.hockey.Team
All Implemented Interfaces:
FaceOff, Position

public class Team
extends java.lang.Object
implements Position, FaceOff

A team.


Field Summary
static int PLAYERS
          Total number of players in a team.
 
Fields inherited from interface fi.utu.cs.hockey.Position
CENTER, GOALKEEPER, LEFT_DEFENSE, LEFT_WING, RIGHT_DEFENSE, RIGHT_WING
 
Fields inherited from interface fi.utu.cs.hockey.rink.FaceOff
CENTER_SPOT, HOME_ENDZONE_LEFT, HOME_ENDZONE_RIGHT, HOME_NEUTRAL_ZONE_LEFT, HOME_NEUTRAL_ZONE_RIGHT, VISITOR_ENDZONE_LEFT, VISITOR_ENDZONE_RIGHT, VISITOR_NEUTRAL_ZONE_LEFT, VISITOR_NEUTRAL_ZONE_RIGHT
 
Constructor Summary
Team()
          Constructs an empty, nameless team.
 
Method Summary
 Player addPlayer(int p)
          Creates, returns and adds a player to the position p.
 void faceoff(int s)
          Moves the players of the team to faceoff locations when the faceoff is in the spot s.
 java.lang.String getName()
          Returns the team's name.
 Player getPlayer(int p)
          Returns the player of the position p.
 boolean isFree(int p)
          Returns the whether the position p is not taken already.
 boolean isHome()
          Returns true, if this is the home team.
 void setName(java.lang.String n)
          Sets the team's name to n.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAYERS

public static final int PLAYERS
Total number of players in a team.

See Also:
Constant Field Values
Constructor Detail

Team

public Team()
Constructs an empty, nameless team.

Method Detail

getName

public java.lang.String getName()
Returns the team's name.


setName

public void setName(java.lang.String n)
Sets the team's name to n.


isHome

public boolean isHome()
Returns true, if this is the home team.


addPlayer

public Player addPlayer(int p)
Creates, returns and adds a player to the position p.

See Also:
Position

getPlayer

public Player getPlayer(int p)
Returns the player of the position p.


isFree

public boolean isFree(int p)
Returns the whether the position p is not taken already.


faceoff

public void faceoff(int s)
Moves the players of the team to faceoff locations when the faceoff is in the spot s.

See Also:
FaceOff

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object