com.croftsoft.apps.mars.model
Interface World

All Superinterfaces:
WorldAccessor
All Known Implementing Classes:
SeriWorld

public interface World
extends WorldAccessor

Provides methods for manipulating the Models in the game.

Since:
2003-04-14
Version:
2003-05-11
Author:
David Wallace Croft

Method Summary
 void clear()
           
 AmmoDump createAmmoDump(double centerX, double centerY)
           
 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.
 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.
 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 interface com.croftsoft.apps.mars.model.WorldAccessor
getModelAccessors
 

Method Detail

clear

void clear()

createAmmoDump

AmmoDump createAmmoDump(double centerX,
                        double centerY)

createObstacle

Obstacle createObstacle(double centerX,
                        double centerY,
                        double radius,
                        double radiusMin,
                        Rectangle driftBounds)

createTank

Tank createTank(double centerX,
                double centerY,
                Color color)

remove

void remove(Model model)

prepare

void prepare()

update

void update(double timeDelta)

fireBullet

void fireBullet(double originX,
                double originY,
                double heading)
Fires a Bullet from the origin.


getAmmoDumps

AmmoDump[] getAmmoDumps(PointXY pointXY,
                        AmmoDump[] ammoDumps)
Gets all active AmmoDumps that contain the point.


getObstacles

Obstacle[] getObstacles()
Gets all active and inactive Obstacles in the World.


getTanks

Tank[] getTanks()
Gets all active and inactive Tanks in the World.


getClosestAmmoDumpCenter

PointXY getClosestAmmoDumpCenter(PointXY pointXY)
Gets the center of the active AmmoDump that is closest to the point.


getClosestEnemyTankCenter

PointXY getClosestEnemyTankCenter(PointXY pointXY,
                                  Color friendColor)
Gets the center of the closest active tank that is not of the color.


getDamageables

Damageable[] getDamageables(Shape shape,
                            Damageable[] damageables)
Gets all active Damageables that overlap the shape.


getImpassables

Iterator getImpassables(Shape shape,
                        Model model)
Gets all active Impassables that overlap the shape.


getModel

Model getModel(PointXY pointXY,
               Class[] classes,
               Model model)
Gets an active Model that contains the point.

Parameters:
classes - The returned Model will be an instance of one of the classes.
model - The Model to ignore, usually the one calling this method.

isBlocked

boolean isBlocked(Model model)
Determines whether an active Impassable overlaps the model shape.


isBlocked

boolean isBlocked(Shape shape,
                  Model model)
Determines whether an active Impassable overlaps the shape.

Parameters:
model - The model to ignore.

isBlockedByObstacle

boolean isBlockedByObstacle(Shape shape)

CroftSoft Javadoc

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