com.croftsoft.apps.mars.model.seri
Class SeriWorld

java.lang.Object
  extended by com.croftsoft.apps.mars.model.seri.SeriWorld
All Implemented Interfaces:
World, WorldAccessor, Serializable

public final class SeriWorld
extends Object
implements World, Serializable

A World implementation.

Since:
2003-04-03
Version:
2003-05-11
See Also:
Serialized Form
Author:
David Wallace Croft

Constructor Summary
SeriWorld(Random random, SeriAmmoDump.Shared seriAmmoDumpShared)
           
 
Method Summary
 void clear()
           
 AmmoDump createAmmoDump(double centerX, double centerY)
           
 Bullet createBullet(double originX, double originY, double heading)
           
 Obstacle createObstacle(double centerX, double centerY, double radius, double radiusMin, Rectangle driftBounds)
           
 Tank createTank(double centerX, double centerY, Color color)
           
 void fireBullet(double originX, double originY, double heading)
          Fires a Bullet from the origin.
 AmmoDump[] getAmmoDumps(PointXY pointXY, AmmoDump[] ammoDumps)
          Gets all active AmmoDumps that contain the point.
 PointXY getClosestAmmoDumpCenter(PointXY pointXY)
          Gets the center of the active AmmoDump that is closest to the point.
 PointXY getClosestEnemyTankCenter(PointXY pointXY, Color friendColor)
          Gets the center of the closest active tank that is not of the color.
 Damageable[] getDamageables(Shape shape, Damageable[] damageables)
          Gets all active Damageables that overlap the shape.
 Impassable[] getImpassables()
           
 Iterator getImpassables(Shape shape, Model model)
          Gets all active Impassables that overlap the shape.
 Model getModel(PointXY pointXY, Class[] classes, Model model)
          Gets an active Model that contains the point.
 ModelAccessor[] getModelAccessors(ModelAccessor[] modelAccessors)
          Gets all ModelAccessors, active and inactive.
 ModelAccessor[] getModelAccessors(Shape shape, ModelAccessor[] modelAccessors)
           
 Model[] getModels()
           
 Obstacle[] getObstacles()
          Gets all active and inactive Obstacles in the World.
 Tank[] getTanks()
          Gets all active and inactive Tanks in the World.
 boolean isBlocked(Model model)
          Determines whether an active Impassable overlaps the model shape.
 boolean isBlocked(Shape shape, Model model)
          Determines whether an active Impassable overlaps the shape.
 boolean isBlockedByObstacle(Shape shape)
           
 void prepare()
           
 void remove(Model model)
           
 void update(double timeDelta)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeriWorld

public SeriWorld(Random random,
                 SeriAmmoDump.Shared seriAmmoDumpShared)
Method Detail

clear

public void clear()
Specified by:
clear in interface World

createAmmoDump

public AmmoDump createAmmoDump(double centerX,
                               double centerY)
Specified by:
createAmmoDump in interface World

createBullet

public Bullet createBullet(double originX,
                           double originY,
                           double heading)

createObstacle

public Obstacle createObstacle(double centerX,
                               double centerY,
                               double radius,
                               double radiusMin,
                               Rectangle driftBounds)
Specified by:
createObstacle in interface World

createTank

public Tank createTank(double centerX,
                       double centerY,
                       Color color)
Specified by:
createTank in interface World

remove

public void remove(Model model)
Specified by:
remove in interface World

getAmmoDumps

public AmmoDump[] getAmmoDumps(PointXY pointXY,
                               AmmoDump[] ammoDumps)
Description copied from interface: World
Gets all active AmmoDumps that contain the point.

Specified by:
getAmmoDumps in interface World

getDamageables

public Damageable[] getDamageables(Shape shape,
                                   Damageable[] damageables)
Description copied from interface: World
Gets all active Damageables that overlap the shape.

Specified by:
getDamageables in interface World

getImpassables

public Impassable[] getImpassables()

getImpassables

public Iterator getImpassables(Shape shape,
                               Model model)
Description copied from interface: World
Gets all active Impassables that overlap the shape.

Specified by:
getImpassables in interface World

getModels

public Model[] getModels()

getModelAccessors

public ModelAccessor[] getModelAccessors(ModelAccessor[] modelAccessors)
Description copied from interface: WorldAccessor
Gets all ModelAccessors, active and inactive.

Specified by:
getModelAccessors in interface WorldAccessor

getModelAccessors

public ModelAccessor[] getModelAccessors(Shape shape,
                                         ModelAccessor[] modelAccessors)

getObstacles

public Obstacle[] getObstacles()
Description copied from interface: World
Gets all active and inactive Obstacles in the World.

Specified by:
getObstacles in interface World

getTanks

public Tank[] getTanks()
Description copied from interface: World
Gets all active and inactive Tanks in the World.

Specified by:
getTanks in interface World

prepare

public void prepare()
Specified by:
prepare in interface World

update

public void update(double timeDelta)
Specified by:
update in interface World

fireBullet

public void fireBullet(double originX,
                       double originY,
                       double heading)
Description copied from interface: World
Fires a Bullet from the origin.

Specified by:
fireBullet in interface World

isBlockedByObstacle

public boolean isBlockedByObstacle(Shape shape)
Specified by:
isBlockedByObstacle in interface World

isBlocked

public boolean isBlocked(Shape shape,
                         Model model)
Description copied from interface: World
Determines whether an active Impassable overlaps the shape.

Specified by:
isBlocked in interface World
model - The model to ignore.

isBlocked

public boolean isBlocked(Model model)
Description copied from interface: World
Determines whether an active Impassable overlaps the model shape.

Specified by:
isBlocked in interface World

getClosestAmmoDumpCenter

public PointXY getClosestAmmoDumpCenter(PointXY pointXY)
Description copied from interface: World
Gets the center of the active AmmoDump that is closest to the point.

Specified by:
getClosestAmmoDumpCenter in interface World

getClosestEnemyTankCenter

public PointXY getClosestEnemyTankCenter(PointXY pointXY,
                                         Color friendColor)
Description copied from interface: World
Gets the center of the closest active tank that is not of the color.

Specified by:
getClosestEnemyTankCenter in interface World

getModel

public Model getModel(PointXY pointXY,
                      Class[] classes,
                      Model model)
Description copied from interface: World
Gets an active Model that contains the point.

Specified by:
getModel in interface World
classes - The returned Model will be an instance of one of the classes.
model - The Model to ignore, usually the one calling this method.

CroftSoft Javadoc

CroftSoft Apps Javadoc (2008-09-28 21:15:07)