public class Score
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.awt.Color[] |
COLOR
The Colors in the game.
|
Manager |
manager
The manager for which this Score object keeps track.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
colorContains(java.awt.Color c)
Return true iff c is in Score.COLOR.
|
static int |
cost(int s)
Return the cost of traveling one frame at rate of speed s.
|
static java.awt.Color |
getColor(java.lang.String s)
Return the color represented by s (its toString format),
that color's toString() output.
|
static java.awt.Color |
getRandomColor()
Return a random Color from Score.Color.
|
int |
getScore()
Return the current score.
|
java.lang.String |
toString()
Return the current score value as a String.
|
int |
value()
Return the current score.
|
public static final java.awt.Color[] COLOR
public final Manager manager
public static java.awt.Color getRandomColor()
public static boolean colorContains(java.awt.Color c)
c
- - the Color to checkpublic static java.awt.Color getColor(java.lang.String s)
public static int cost(int s) throws java.lang.IllegalArgumentException
Cost =
if (s < Efficient_Speed) -> s + 1
else if (s > Efficient_Speed) -> s + fib(s - Efficient_Speed)
else -> s
java.lang.IllegalArgumentException
- if s is out of the range min..max.public int getScore()
public int value()
public java.lang.String toString()
toString
in class java.lang.Object