info.gridworld.actor
Class Rock

java.lang.Object
  extended by info.gridworld.actor.Actor
      extended by info.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()
          Override this method to define the action of this actor.
 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 info.gridworld.actor.Actor
getColor, getDirection, getGrid, getLocation, moveTo, putSelfInGrid, removeSelfFromGrid, setDirection, toString
 
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()
Description copied from class: Actor
Override this method to define the action of this actor.

Specified by:
act in class Actor