|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavoids.Shapes
public final class Shapes
A class to represent the shapes in this game.
Nested Class Summary | |
---|---|
static class |
Shapes.Shape
An enum of available shapes. |
Field Summary | |
---|---|
private static java.util.HashMap<Shapes.Shape,java.util.Vector<java.awt.Color>> |
colorMap
a mapping of shape names to colors that go with the areas of the shape |
private static double |
cos30
constant for cos(30 degrees) |
private static double |
cos30_2
constant for cos(30 degrees) / 2 |
private static double |
cos45
constant for cos(45 degrees) |
protected static int |
DEFAULT_SIZE
the default size of a shape |
protected static int |
MAX_SIZE
the maximum size for a shape |
protected static int |
MIN_SIZE
the minimum size for a shape |
private static long |
serialVersionUID
This is the version used for serializing/deserializing (storing/retrieving) this object |
private static java.util.HashMap<Shapes.Shape,java.util.Vector<java.awt.geom.Area>> |
shapeMap
a mapping of shape names to areas that make up the shape |
private static double |
sin30
constant for sin(30 degrees) |
private static double |
sin30_2
constant for sin(30 degrees) / 2 |
private static double |
sin45
constant for sin(45 degrees) |
Constructor Summary | |
---|---|
Shapes()
|
Method Summary | |
---|---|
static java.util.Vector<java.awt.geom.Area> |
getAreas(Shapes.Shape shape,
int _size,
int maximumSize)
|
static java.util.Vector<java.awt.Color> |
getColors(Shapes.Shape shape)
|
static Shapes.Shape |
getShape(int number)
|
java.lang.String |
toString()
Provide a String representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final double sin30
private static final double cos30
private static final double sin30_2
private static final double cos30_2
private static final double sin45
private static final double cos45
protected static final int MAX_SIZE
protected static final int MIN_SIZE
protected static final int DEFAULT_SIZE
private static java.util.HashMap<Shapes.Shape,java.util.Vector<java.awt.geom.Area>> shapeMap
private static java.util.HashMap<Shapes.Shape,java.util.Vector<java.awt.Color>> colorMap
Constructor Detail |
---|
public Shapes()
Method Detail |
---|
public static Shapes.Shape getShape(int number)
number
- the integer representation of a shape (in order of the shape name appearing in the enum)
public static java.util.Vector<java.awt.geom.Area> getAreas(Shapes.Shape shape, int _size, int maximumSize)
shape
- the name of a shape_size
- the size of the areas used to represent this shapemaximumSize
- the maximum size this shape can be
public static java.util.Vector<java.awt.Color> getColors(Shapes.Shape shape)
shape
- the shape name
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |