|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectSpaceshipFactory
public class SpaceshipFactory
Return random spaceships that can be allies (in 2-player mode) or enemies.
| Field Summary | |
|---|---|
protected double |
direction
Direction the created spaceships will fly in. |
static int |
ENEMY1
|
static int |
ENEMY2
|
protected int |
level
Level the created spaceships will (approximately) have. |
static int |
LEVEL_DEVIATION
Random deviation in the level of created spaceships. |
static int |
N_AI_CLASSES
|
protected int |
side
Side the created spaceships will be on. |
| Constructor Summary | |
|---|---|
SpaceshipFactory(int the_side,
int starting_level)
|
|
| Method Summary | |
|---|---|
double |
getDirection()
|
int |
getLevel()
|
void |
increaseLevel()
|
void |
setDirection(double the_direction)
|
void |
setLevel(int new_level)
|
AIControlledSpaceship |
ship()
Return a random AIControlledSpaceship object that can be placed into the world. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int N_AI_CLASSES
public static final int ENEMY1
public static final int ENEMY2
public static final int LEVEL_DEVIATION
protected int side
protected int level
LEVEL_DEVIATIONprotected double direction
| Constructor Detail |
|---|
public SpaceshipFactory(int the_side,
int starting_level)
| Method Detail |
|---|
public void setLevel(int new_level)
public int getLevel()
public void increaseLevel()
public void setDirection(double the_direction)
public double getDirection()
public AIControlledSpaceship ship()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||