Ant Farm - Robert Glen Martin
School for the Talented and Gifted
Dallas I.S.D.

Class QueenAnt

java.lang.Object
  extended by info.gridworld.actor.Actor
      extended by QueenAnt
All Implemented Interfaces:
Processable

public class QueenAnt
extends info.gridworld.actor.Actor
implements Processable

A QueenAnt sits around and waits for a WorkerAnt to bring it food. It does not act.


Field Summary
private  int foodQuantity
          Total amount of food that the queen has received.
 
Constructor Summary
QueenAnt()
          Constructs a QueenAnt actor.
 
Method Summary
 void act()
          "Do nothing" act method.
 void process(WorkerAnt ant)
          Gets food from and gives current location to ant.
 java.lang.String toString()
          Creates a string that describes this actor.
 
Methods inherited from class info.gridworld.actor.Actor
getColor, getDirection, getGrid, getLocation, moveTo, putSelfInGrid, removeSelfFromGrid, setColor, setDirection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

foodQuantity

private int foodQuantity
Total amount of food that the queen has received.

Constructor Detail

QueenAnt

public QueenAnt()
Constructs a QueenAnt actor. The queen is colored magenta.

Method Detail

process

public void process(WorkerAnt ant)
Gets food from and gives current location to ant.

Specified by:
process in interface Processable
Parameters:
ant - the calling WorkerAnt

act

public void act()
"Do nothing" act method. This is provided for the Ant Farm Cake, Cookie, and QueenAnt classes which do not act.

Overrides:
act in class info.gridworld.actor.Actor

toString

public java.lang.String toString()
Creates a string that describes this actor.

Overrides:
toString in class info.gridworld.actor.Actor
Returns:
a string with the Actor information plus the amount of food given to this QueenAnt

© 2007 Robert Glen Martin.
All rights reserved.