dualroids
Class Arena

java.lang.Object
  |
  +--dualroids.Arena
All Implemented Interfaces:
Serializable

public final class Arena
extends Object
implements Serializable

The game arena that holds all the spatial objects.

See Also:
Serialized Form

Field Summary
private  Asteroid[] asteroids
          An array holding all the asteroids
static double HEIGHT
          Constant for the height of the arena.
private  long levelStarts
          The starting time of the level.
private  SpaceShip[] spaceShips
          An array holding all the spaceships
static double WIDTH
          Constant for the width of the arena.
 
Constructor Summary
Arena(int levelNumber, long timestamp)
          Contructs an Arena including the SpatialObjects in it for a new level.
 
Method Summary
 Asteroid[] getAsteroids()
          Return an array holding references to all asteroids.
 long getLevelStarts()
          Returns the starting time of the level.
 SpaceShip[] getSpaceShips()
          Return an array holding references to all spaceships.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

HEIGHT

public static final double HEIGHT
Constant for the height of the arena. Must match SpaceArea.WINDOW_HEIGHT.

WIDTH

public static final double WIDTH
Constant for the width of the arena. Must match SpaceArea.WINDOW_WIDTH.

spaceShips

private final SpaceShip[] spaceShips
An array holding all the spaceships

asteroids

private final Asteroid[] asteroids
An array holding all the asteroids

levelStarts

private final long levelStarts
The starting time of the level.
Constructor Detail

Arena

public Arena(int levelNumber,
             long timestamp)
Contructs an Arena including the SpatialObjects in it for a new level.
Parameters:
levelNumber - the level number
timestamp - the starting time of the level
Method Detail

getSpaceShips

public final SpaceShip[] getSpaceShips()
Return an array holding references to all spaceships. The caller should not write to the array.
Returns:
an array holding references to all spaceships

getAsteroids

public final Asteroid[] getAsteroids()
Return an array holding references to all asteroids. The caller should not write to the array.
Returns:
an array holding references to all asteroids

getLevelStarts

public final long getLevelStarts()
Returns the starting time of the level.
Returns:
the starting time of the level


Dualroids was written by Oskar Ojala, Yrjö Kari-Koskinen and Henri Sivonen