com.collegeboard.gridworld.actor
Class Rock

java.lang.Object
  extended by com.collegeboard.gridworld.actor.Actor
      extended by com.collegeboard.gridworld.actor.Rock

public class Rock
extends Actor

A rock is an actor that does nothing. It is commonly used to block other actors from moving.

copyright© 2005 Cay S. Horstmann (http://horstmann.com)

Author:
Cay Horstmann

Constructor Summary
Rock()
           
 
Method Summary
 void act()
          This method defines the abstract method of the Actor class to do nothing.
 void setColor(Color newColor)
          This method overrides the setColor method in the Actor class to do nothing--rocks are always black.
 
Methods inherited from class com.collegeboard.gridworld.actor.Actor
getColor, getDirection, getGrid, getLocation, getValidNeighborLocations, moveTo, putSelfInGrid, removeSelfFromGrid, toString, turn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rock

public Rock()
Method Detail

setColor

public void setColor(Color newColor)
This method overrides the setColor method in the Actor class to do nothing--rocks are always black.

Overrides:
setColor in class Actor
Parameters:
newColor - the new color, ignored by this method.

act

public void act()
This method defines the abstract method of the Actor class to do nothing.

Specified by:
act in class Actor