uk.ac.nott.cs.g54dia.library
Class MoveTowardsAction

java.lang.Object
  extended by uk.ac.nott.cs.g54dia.library.MoveTowardsAction
All Implemented Interfaces:
Action

public class MoveTowardsAction
extends java.lang.Object
implements Action

Action which moves the tanker towards a given Point in the environment.


Field Summary
private  Point target
           
 
Constructor Summary
MoveTowardsAction(Point t)
           
 
Method Summary
 void execute(Environment env, Tanker tanker)
          Execute the action for this Tanker in this Environment.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

target

private Point target
Constructor Detail

MoveTowardsAction

public MoveTowardsAction(Point t)
Method Detail

execute

public void execute(Environment env,
                    Tanker tanker)
             throws ActionFailedException
Description copied from interface: Action
Execute the action for this Tanker in this Environment.

Specified by:
execute in interface Action
Parameters:
env - The Environment that the Tanker inhabits.
tanker - The Tanker trying to perform this action.
Throws:
ActionFailedException - The action couldn't be performed.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object