Class SpaceshipFactory

java.lang.Object
  extended by SpaceshipFactory

public class SpaceshipFactory
extends java.lang.Object

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

N_AI_CLASSES

public static final int N_AI_CLASSES
See Also:
Constant Field Values

ENEMY1

public static final int ENEMY1
See Also:
Constant Field Values

ENEMY2

public static final int ENEMY2
See Also:
Constant Field Values

LEVEL_DEVIATION

public static final int LEVEL_DEVIATION
Random deviation in the level of created spaceships.

See Also:
Constant Field Values

side

protected int side
Side the created spaceships will be on.


level

protected int level
Level the created spaceships will (approximately) have.

See Also:
LEVEL_DEVIATION

direction

protected double direction
Direction the created spaceships will fly in.

Constructor Detail

SpaceshipFactory

public SpaceshipFactory(int the_side,
                        int starting_level)
Method Detail

setLevel

public void setLevel(int new_level)

getLevel

public int getLevel()

increaseLevel

public void increaseLevel()

setDirection

public void setDirection(double the_direction)

getDirection

public double getDirection()

ship

public AIControlledSpaceship ship()
Return a random AIControlledSpaceship object that can be placed into the world.

Returns:
the ship, randomly selected.