objects
Class World

java.lang.Object
  |
  +--objects.World

public final class World
extends java.lang.Object

Author:
Sverre H. Huseby <shh@thathost.com>

Field Summary
static int TURN_LEFT
           
static int TURN_NONE
           
static int TURN_RIGHT
           
 
Constructor Summary
World()
           
World(int width, int height)
           
 
Method Summary
 void addBomb(Bomb b)
           
 void addBombPack(BombPack bp)
           
 void addCollidable(DrawableGameObject o)
           
 void addDecoration(DrawableGameObject o)
           
 void addExplosion(Explosion e)
           
 void addPhaser(Phaser p)
           
 void addPlayer(Player p)
           
 void addStar(Star s)
           
 Bomb findBomb(short id)
           
 BombPack findBombPack(short id)
           
 Explosion findExplosion(short id)
           
 java.awt.Point findGoodLocation()
           
 Phaser findPhaser(short id)
           
 Player findPlayer(short id)
           
 double getAbsDeltaAngle(double angle1, double angle2)
           
 double getAngle(int fromX, int fromY, int toX, int toY)
           
 int getBestTurn(double oldAngle, double newAngle)
           
 BombPack[] getBombPacks()
           
 Bomb[] getBombs()
           
 BombPack getClosestBombPack(int myX, int myY)
           
 BombPack getClosestBombPack(Player me)
           
 Player getClosestEnemy(Player me)
           
 Player getClosestEnemy(Player me, int myX, int myY)
           
 Bomb getClosestEnemyBomb(Player me)
           
 Bomb getClosestEnemyBomb(Player me, int myX, int myY)
           
 Phaser getClosestEnemyPhaser(Player me)
           
 Phaser getClosestEnemyPhaser(Player me, int myX, int myY)
           
 double getDeltaAngle(double fromAngle, double toAngle)
           
 int getDistanceBetween(DrawableGameObject o1, DrawableGameObject o2)
           
 int getDistanceBetween(DrawableGameObject o, int x, int y)
           
 int getDistanceBetween(int x0, int y0, int x1, int y1)
           
 int getDistanceToClosestCollidable(int x, int y)
           
 Explosion[] getExplosions()
           
 int getHeight()
           
 DrawableGameObject[] getObjects(java.awt.Rectangle bounds)
           
 Phaser[] getPhasers()
           
 Player[] getPlayers()
           
 int getSquareDistanceBetween(DrawableGameObject o1, DrawableGameObject o2)
           
 int getSquareDistanceBetween(DrawableGameObject o, int x, int y)
           
 int getSquareDistanceBetween(int x0, int y0, int x1, int y1)
           
 Star[] getStars()
           
 int getWidth()
           
 void removeBomb(Bomb b)
           
 void removeBombPack(BombPack bp)
           
 void removeCollidable(DrawableGameObject o)
           
 void removeDecoration(DrawableGameObject o)
           
 void removeExplosion(Explosion e)
           
 void removePhaser(Phaser p)
           
 void removePlayer(Player p)
           
 void setSize(int width, int height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TURN_NONE

public static final int TURN_NONE
See Also:
Constant Field Values

TURN_LEFT

public static final int TURN_LEFT
See Also:
Constant Field Values

TURN_RIGHT

public static final int TURN_RIGHT
See Also:
Constant Field Values
Constructor Detail

World

public World()

World

public World(int width,
             int height)
Method Detail

setSize

public final void setSize(int width,
                          int height)

getWidth

public final int getWidth()

getHeight

public final int getHeight()

addCollidable

public final void addCollidable(DrawableGameObject o)

removeCollidable

public final void removeCollidable(DrawableGameObject o)

addDecoration

public final void addDecoration(DrawableGameObject o)

removeDecoration

public final void removeDecoration(DrawableGameObject o)

getObjects

public final DrawableGameObject[] getObjects(java.awt.Rectangle bounds)

getSquareDistanceBetween

public final int getSquareDistanceBetween(DrawableGameObject o1,
                                          DrawableGameObject o2)

getDistanceBetween

public final int getDistanceBetween(DrawableGameObject o1,
                                    DrawableGameObject o2)

getSquareDistanceBetween

public final int getSquareDistanceBetween(DrawableGameObject o,
                                          int x,
                                          int y)

getDistanceBetween

public final int getDistanceBetween(DrawableGameObject o,
                                    int x,
                                    int y)

getSquareDistanceBetween

public final int getSquareDistanceBetween(int x0,
                                          int y0,
                                          int x1,
                                          int y1)

getDistanceBetween

public final int getDistanceBetween(int x0,
                                    int y0,
                                    int x1,
                                    int y1)

getClosestEnemy

public final Player getClosestEnemy(Player me,
                                    int myX,
                                    int myY)

getClosestEnemy

public final Player getClosestEnemy(Player me)

getClosestEnemyBomb

public final Bomb getClosestEnemyBomb(Player me,
                                      int myX,
                                      int myY)

getClosestEnemyBomb

public final Bomb getClosestEnemyBomb(Player me)

getClosestEnemyPhaser

public final Phaser getClosestEnemyPhaser(Player me,
                                          int myX,
                                          int myY)

getClosestEnemyPhaser

public final Phaser getClosestEnemyPhaser(Player me)

getClosestBombPack

public final BombPack getClosestBombPack(int myX,
                                         int myY)

getClosestBombPack

public final BombPack getClosestBombPack(Player me)

getDistanceToClosestCollidable

public final int getDistanceToClosestCollidable(int x,
                                                int y)

findGoodLocation

public final java.awt.Point findGoodLocation()

getAngle

public final double getAngle(int fromX,
                             int fromY,
                             int toX,
                             int toY)

getDeltaAngle

public final double getDeltaAngle(double fromAngle,
                                  double toAngle)

getAbsDeltaAngle

public final double getAbsDeltaAngle(double angle1,
                                     double angle2)

getBestTurn

public final int getBestTurn(double oldAngle,
                             double newAngle)

addStar

public final void addStar(Star s)

getStars

public final Star[] getStars()

addPlayer

public final void addPlayer(Player p)

removePlayer

public final void removePlayer(Player p)

getPlayers

public final Player[] getPlayers()

findPlayer

public final Player findPlayer(short id)

addPhaser

public final void addPhaser(Phaser p)

removePhaser

public final void removePhaser(Phaser p)

getPhasers

public final Phaser[] getPhasers()

findPhaser

public final Phaser findPhaser(short id)

addBomb

public final void addBomb(Bomb b)

removeBomb

public final void removeBomb(Bomb b)

getBombs

public final Bomb[] getBombs()

findBomb

public final Bomb findBomb(short id)

addBombPack

public final void addBombPack(BombPack bp)

removeBombPack

public final void removeBombPack(BombPack bp)

getBombPacks

public final BombPack[] getBombPacks()

findBombPack

public final BombPack findBombPack(short id)

addExplosion

public final void addExplosion(Explosion e)

removeExplosion

public final void removeExplosion(Explosion e)

getExplosions

public final Explosion[] getExplosions()

findExplosion

public final Explosion findExplosion(short id)