Class Command

java.lang.Object
  |
  +--IdentifiedWithPosition
        |
        +--Command

public class Command
extends IdentifiedWithPosition

A command, which one is, and all the arguments of it.


Inner Class Summary
private  class Command.PackageBox
          a little wrapper class
 
Field Summary
(package private)  int bid
          Cost of executing this command
static java.lang.String[] commands
           
static int DROP
          Drop command
static int MOVE
          Move command
private  Command.PackageBox pb
          A place to store packages
static int PICK
          Pick command
 
Fields inherited from class IdentifiedWithPosition
id, x_pos, y_pos
 
Constructor Summary
Command()
          Default Constructor
Command(int comm, int x, int y, int b)
           
 
Method Summary
(package private)  void addPackage(Package p)
          Add a package for the PICK or DROP commands
(package private)  java.util.Iterator arguments()
          returns an iterator of packages arguments
 int bid()
          Returns the bid of the command
 java.util.LinkedList packs()
           
 void setBid(int b)
          sets the bid of the command
 
Methods inherited from class IdentifiedWithPosition
id, setId, setPos, setX, setY, x, y
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MOVE

public static final int MOVE
Move command

PICK

public static final int PICK
Pick command

DROP

public static final int DROP
Drop command

commands

public static final java.lang.String[] commands

pb

private Command.PackageBox pb
A place to store packages

bid

int bid
Cost of executing this command
Constructor Detail

Command

public Command(int comm,
               int x,
               int y,
               int b)

Command

public Command()
Default Constructor
Method Detail

addPackage

void addPackage(Package p)
Add a package for the PICK or DROP commands
Parameters:
p - package to be added

setBid

public void setBid(int b)
sets the bid of the command
Parameters:
b - the bid

packs

public java.util.LinkedList packs()

bid

public int bid()
Returns the bid of the command
Returns:
the bid of the command

arguments

java.util.Iterator arguments()
returns an iterator of packages arguments
Returns:
an iterator of packages