|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ScoreBoard
Field Summary | |
static int |
SECSINPERIOD
|
Constructor Summary | |
ScoreBoard()
Creates new ScoreBoard |
Method Summary | |
void |
adjustClock(int secs)
Change the value for seconds left in a period - pass negative number if want to decrease (take time off the clock) pass a positive number to add time |
void |
beginGame(java.lang.String home,
java.lang.String away)
Establish a bunch of things appropriate to the beginning of a game |
void |
copyMe(ScoreBoard toChange)
Make a passed score board a copy of the current (calling) score board Not necessary because we have the above - but done to illustrate that object parameters are called by reference - so they can be changed inside the method (unlike primitive parameters such as ints) copy all instance variables |
void |
copyOf(ScoreBoard toCopy)
Make a score board a copy of a passed scoreboard copy all instance variables |
boolean |
endPeriod()
reports whether the period is over (clock is zero) |
boolean |
equals(ScoreBoard toCompare)
Determine if two scoreboards should be considered equal I think probably we want all instance variables to be equal in order to consider the objects equal |
java.lang.String |
getAwayName()
Report away teams name |
int |
getAwayScore()
Report away teams score |
int |
getCurrMargin()
return how much the leading team is leading by |
java.lang.String |
getHomeName()
Report home teams name |
int |
getHomeScore()
Report home teams score |
java.lang.String |
getLeadingTeam()
Report who is leading |
int |
getPeriod()
Report which period it is |
int |
getTimeLeft()
Report number of seconds left in period |
java.lang.String |
getTimeLeftString()
Report time left in period in a friendly string format |
int |
makeFoulShot(java.lang.String team)
score a foul shot (1 point) for a given team |
int |
makeThreePoint(java.lang.String team)
score a three point shot (long field goal) for a given team |
int |
makeTwoPoint(java.lang.String team)
score a two point shot (regular field goal) for a given team |
void |
nextPeriod()
advance the period number to the next period |
void |
setAwayName(java.lang.String name)
Establish a new value for away teams name - should probably only be used at very beginning |
void |
setAwayScore(int score)
Establish a new value for away teams score - should probably only be used at very beginning |
void |
setHomeName(java.lang.String name)
Establish a new value for home teams name - should probably only be used at very beginningwhich period it is |
void |
setHomeScore(int score)
Establish a new value for home teams score - should probably only be used at very beginning |
void |
setPeriod(int per)
Establish a new value for period in game - should probably only be used at very beginning |
void |
setTimeLeft(int secs)
Establish a new value for seconds left in a period - should probably only be used at very beginning |
java.lang.String |
toString()
Prepare for nice output of score board |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int SECSINPERIOD
Constructor Detail |
public ScoreBoard()
Method Detail |
public java.lang.String getHomeName()
public java.lang.String getAwayName()
public int getHomeScore()
public int getAwayScore()
public int getTimeLeft()
public java.lang.String getTimeLeftString()
public java.lang.String getLeadingTeam()
public int getCurrMargin()
public int getPeriod()
public boolean endPeriod()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(ScoreBoard toCompare)
public void beginGame(java.lang.String home, java.lang.String away)
public void setHomeName(java.lang.String name)
public void setAwayName(java.lang.String name)
public void setHomeScore(int score)
public void setAwayScore(int score)
public void setPeriod(int per)
public void setTimeLeft(int secs)
public void adjustClock(int secs)
public int makeFoulShot(java.lang.String team)
public int makeTwoPoint(java.lang.String team)
public int makeThreePoint(java.lang.String team)
public void nextPeriod()
public void copyOf(ScoreBoard toCopy)
public void copyMe(ScoreBoard toChange)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |