sysModel.env
Class ASquareEnv.ASquareLocalEnvironment

java.lang.Object
  extended by sysModel.env.AGlobalEnv.ALocalEnv
      extended by sysModel.env.ASquareEnv.ASquareLocalEnvironment
Direct Known Subclasses:
BoundedEnv.LocalEnvironment, UnboundedEnv.LocalEnvironment
Enclosing class:
ASquareEnv

protected abstract class ASquareEnv.ASquareLocalEnvironment
extends AGlobalEnv.ALocalEnv

Concrete local environment for the square environment.


Field Summary
 
Fields inherited from class sysModel.env.AGlobalEnv.ALocalEnv
_state
 
Constructor Summary
protected ASquareEnv.ASquareLocalEnvironment()
           
 
Method Summary
abstract  ASquareEnv.Direction direction()
          Accessor for the direction.
 void drawFish(AFish fish, java.awt.Graphics2D g, java.awt.Component comp)
          Draw the fish on the graphics object.
abstract  ASquareEnv.Location location()
          Accessor for the location.
 java.lang.String toString()
          String representation of the local environment.
 void turnRight(AFish fish, double radians)
          Turn the fish radians to the right.
 
Methods inherited from class sysModel.env.AGlobalEnv.ALocalEnv
execute, makeMoveFwdLocalEnv, makeMoveLambda, removeFish, setState, tryBreedFwd, tryMoveFwd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASquareEnv.ASquareLocalEnvironment

protected ASquareEnv.ASquareLocalEnvironment()
Method Detail

location

public abstract ASquareEnv.Location location()
Accessor for the location.

Returns:
location

direction

public abstract ASquareEnv.Direction direction()
Accessor for the direction.

Returns:
direction

drawFish

public void drawFish(AFish fish,
                     java.awt.Graphics2D g,
                     java.awt.Component comp)
Draw the fish on the graphics object. The graphics object still has to be translated and rotated properly,

Specified by:
drawFish in class AGlobalEnv.ALocalEnv
Parameters:
fish - AFish to drawFish
g - graphics object to drawFish on
comp - component to drawFish on

turnRight

public void turnRight(AFish fish,
                      double radians)
Turn the fish radians to the right.

Specified by:
turnRight in class AGlobalEnv.ALocalEnv
Parameters:
fish - AFish to turn
radians - radians to turn

toString

public java.lang.String toString()
String representation of the local environment. Should be "(x, y) (dx, dy)".

Overrides:
toString in class java.lang.Object
Returns:
string representation