alice.kareltherobot
Class StairClimber

java.lang.Object
  extended by edu.cmu.cs.dennisc.pattern.DefaultReleasable
      extended by edu.cmu.cs.dennisc.pattern.AbstractElement
          extended by edu.cmu.cs.dennisc.pattern.DefaultInstancePropertyOwner
              extended by org.alice.apis.moveandturn.Element
                  extended by org.alice.apis.moveandturn.Composite
                      extended by org.alice.apis.moveandturn.AbstractTransformable
                          extended by org.alice.apis.moveandturn.Transformable
                              extended by org.alice.apis.moveandturn.Model
                                  extended by org.alice.apis.moveandturn.PolygonalModel
                                      extended by org.alice.apis.moveandturn.gallery.GalleryModel
                                          extended by org.alice.apis.moveandturn.gallery.scifi.KoalaRobot
                                              extended by alice.kareltherobot.UrRobot
                                                  extended by alice.kareltherobot.StairClimber
All Implemented Interfaces:
edu.cmu.cs.dennisc.codec.ReferenceableBinaryEncodableAndDecodable, edu.cmu.cs.dennisc.pattern.Nameable, edu.cmu.cs.dennisc.pattern.NameChangeListenable, edu.cmu.cs.dennisc.pattern.Releasable, edu.cmu.cs.dennisc.property.InstancePropertyOwner, edu.cmu.cs.dennisc.property.PropertyOwner, org.alice.apis.moveandturn.ReferenceFrame

public class StairClimber
extends alice.kareltherobot.UrRobot

The task of a stair climber is to climb three steps and pick up a beeper from the top step.

Author:
jbergin

Nested Class Summary
 
Nested classes/interfaces inherited from class org.alice.apis.moveandturn.gallery.scifi.KoalaRobot
org.alice.apis.moveandturn.gallery.scifi.KoalaRobot.Part
 
Field Summary
 
Fields inherited from class org.alice.apis.moveandturn.gallery.GalleryModel
MODELED_BY_CREDIT_PROPERTY, PAINTED_BY_CREDIT_PROPERTY, PROGRAMMED_BY_CREDIT_PROPERTY
 
Fields inherited from class org.alice.apis.moveandturn.PolygonalModel
POLYGONS_PROPERTY
 
Fields inherited from class org.alice.apis.moveandturn.Model
COLOR_PROPERTY, FILLING_STYLE_PROPERTY, IS_BOUNDING_BOX_SHOWING_PROPERTY, IS_BOUNDING_SPHERE_SHOWING_PROPERTY, IS_SHOWING_PROPERTY, OPACITY_PROPERTY, POTENTIAL_SURFACE_TEXTURES_PROPERTY, SHADING_STYLE_PROPERTY, SURFACE_TEXTURE_PROPERTY, VISUAL_SCALE_PROPERTY
 
Fields inherited from class org.alice.apis.moveandturn.Transformable
DEFAULT_ORIGIN_INCLUSION_POLICY, DEFAULT_RESIZE_POLICY, DEFAULT_SET_SIZE_POLICY
 
Fields inherited from class org.alice.apis.moveandturn.AbstractTransformable
LOCAL_POINT_OF_VIEW_PROPERTY
 
Fields inherited from class org.alice.apis.moveandturn.Composite
COMPONENTS_PROPERTY, DEFAULT_DURATION, DEFAULT_HOW_MUCH, DEFAULT_SPEED_STYLE, DEFAULT_STYLE, RIGHT_NOW
 
Fields inherited from class org.alice.apis.moveandturn.Element
NAME_PROPERTY
 
Constructor Summary
StairClimber(int street, int avenue, alice.kareltherobot.Direction direction)
          Create a robot on a specific street and avenue, facing a given direction with no beepers.
StairClimber(int street, int avenue, alice.kareltherobot.Direction direction, int beepers)
          Create a robot on a specific street and avenue, facing a given direction with a given number of beepers.
StairClimber(int street, int avenue, alice.kareltherobot.Direction direction, int beepers, org.alice.apis.moveandturn.Color color)
          Create a robot on a specific street and avenue, facing a given direction with a given number of beepers and a given body color.
 
Method Summary
 void climbOneStair()
          Climb a stair one "street" high and one "avenue" wide.
 void climbStairs()
          Climb three stairs
 void getBeeper()
          Climb the three stairs and pick the beeper.
 void task()
          Perform the task and announce its completion.
 void turnRight()
          Robot turns 90 degrees clockwise (to its right).
 
Methods inherited from class alice.kareltherobot.UrRobot
addToWorld, assertFacingEast, assertFacingNorth, assertFacingSouth, assertFacingWest, assertFrontIsBlocked, assertFrontIsClear, assertHasBeepers, assertHasNoBeepers, assertNextToABeeper, assertNextToARobot, assertOnAvenue, assertOnStreet, draw, getCamera, move, pickBeeper, putBeeper, setTracing, toString, turnLeft, turnOff
 
Methods inherited from class org.alice.apis.moveandturn.gallery.scifi.KoalaRobot
getPart
 
Methods inherited from class org.alice.apis.moveandturn.gallery.GalleryModel
getGalleryRootDirectory, getModeledByCredit, getPaintedByCredit, getProgrammedByCredit, main, setModeledByCredit, setPaintedByCredit, setProgrammedByCredit
 
Methods inherited from class org.alice.apis.moveandturn.PolygonalModel
getPolygons, setPolygons
 
Methods inherited from class org.alice.apis.moveandturn.Model
addMouseButtonListener, addPotentialSurfaceTexture, clearPotentialSurfaceTextures, getColor, getFillingStyle, getMouseButtonListeners, getOpacity, getOriginalScale, getPart, getPotentialSurfaceTextureIterable, getPotentialSurfaceTextures, getResizeDepthAmount, getResizeHeightAmount, getResizeWidthAmount, getSGSingleAppearance, getSGVisual, getShadingStyle, getSurfaceTexture, getVisualScale, isShowing, removeMouseButtonListener, removePotentialSurfaceTexture, setColor, setColor, setColor, setColor, setFillingStyle, setName, setOpacity, setOpacity, setOpacity, setOpacity, setPotentialSurfaceTextures, setShadingStyle, setShowing, setSurfaceTexture, setVisualScale
 
Methods inherited from class org.alice.apis.moveandturn.Transformable
addKeyListener, getAxisAlignedMinimumBoundingBox, getAxisAlignedMinimumBoundingBox, getAxisAlignedMinimumBoundingBox, getAxisAlignedMinimumBoundingBox, getBoundingSphere, getBoundingSphere, getBoundingSphere, getBoundingSphere, getDepth, getDistanceAbove, getDistanceBehind, getDistanceBelow, getDistanceInFrontOf, getDistanceTo, getDistanceToTheLeftOf, getDistanceToTheRightOf, getHeight, getKeyListeners, getSGAbstractTransformable, getSGTransformable, getVehicle, getWidth, isAbove, isAbove, isAtLeastThresholdAwayFrom, isBehind, isBehind, isBelow, isBelow, isBoundingBoxShowing, isBoundingSphereShowing, isInFrontOf, isInFrontOf, isLargerThan, isNarrowerThan, isShorterThan, isSmallerThan, isTallerThan, isThickerThan, isThinnerThan, isToTheLeftOf, isToTheLeftOf, isToTheRightOf, isToTheRightOf, isWiderThan, isWithinThresholdOf, realizeIfNecessary, removeKeyListener, resize, resize, resize, resize, resizeDepth, resizeDepth, resizeDepth, resizeDepth, resizeDepth, resizeHeight, resizeHeight, resizeHeight, resizeHeight, resizeHeight, resizeWidth, resizeWidth, resizeWidth, resizeWidth, resizeWidth, say, say, say, say, say, say, setBoundingBoxShowing, setBoundingSphereShowing, setDepth, setDepth, setDepth, setDepth, setDepth, setHeight, setHeight, setHeight, setHeight, setHeight, setVehicle, setWidth, setWidth, setWidth, setWidth, setWidth, think, think, think, think, think, think
 
Methods inherited from class org.alice.apis.moveandturn.AbstractTransformable
getLocalPointOfView, getLocalTransformation, getOrientation, getOwner, getPosition, getScene, getSGComposite, getTransformation, getTransformation, isPivotShowing, move, move, move, move, moveAndOrientTo, moveAndOrientTo, moveAndOrientTo, moveAtSpeed, moveAtSpeed, moveAtSpeed, moveAwayFrom, moveAwayFrom, moveAwayFrom, moveTo, moveTo, moveTo, moveToward, moveToward, moveToward, orientTo, orientTo, orientTo, orientToUpright, orientToUpright, orientToUpright, orientToUpright, pointAt, pointAt, pointAt, roll, roll, roll, roll, rollAtSpeed, rollAtSpeed, rollAtSpeed, setLocalPointOfView, setLocalTransformation, setPivotShowing, turn, turn, turn, turn, turnAtSpeed, turnAtSpeed, turnAtSpeed, turnToFace, turnToFace, turnToFace
 
Methods inherited from class org.alice.apis.moveandturn.Composite
addComponent, clearComponents, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandInIfNecessary, delay, findAllMatches, findAllMatches, findAllMatches, findAllMatches, findAllMatches, findFirstDescendantNamed, findFirstMatch, findFirstMatch, findFirstMatch, findFirstMatch, findPathsToAllDescendants, getActualReferenceFrame, getBooleanFromUser, getComponentIterable, getComponents, getDescendant, getDoubleFromUser, getGlobalSimulationSpeedFactor, getIntegerFromUser, getLookingGlass, getName, getPointOfView, getSGReferenceFrame, getStringFromUser, print, removeComponent, setComponents, setGlobalSimulationSpeedFactor, transformFromAWT, transformFromAWT, transformToAWT, transformToAWT
 
Methods inherited from class org.alice.apis.moveandturn.Element
getElement, isComposedOfGetterAndSetterProperties
 
Methods inherited from class edu.cmu.cs.dennisc.pattern.DefaultInstancePropertyOwner
accessListPropertyListeners, accessPropertyListeners, addListPropertyListener, addPropertyListener, decode, encode, equals, fireAdded, fireAdding, fireCleared, fireClearing, firePropertyChanged, firePropertyChanging, fireRemoved, fireRemoving, fireSet, fireSetting, getInstancePropertyNamed, getProperties, getPropertyNamed, isEquivalentTo, lookupNameFor, removeListPropertyListener, removePropertyListener
 
Methods inherited from class edu.cmu.cs.dennisc.pattern.AbstractElement
accessNameListeners, addNameListener, removeNameListener
 
Methods inherited from class edu.cmu.cs.dennisc.pattern.DefaultReleasable
accessReleaseListeners, addReleaseListener, release, removeReleaseListener
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StairClimber

public StairClimber(int street,
                    int avenue,
                    alice.kareltherobot.Direction direction)
Create a robot on a specific street and avenue, facing a given direction with no beepers.

Parameters:
street - the street on which to place the robot
avenue - the avenue on which to place the robot
direction - the direction the robot will initially face

StairClimber

public StairClimber(int street,
                    int avenue,
                    alice.kareltherobot.Direction direction,
                    int beepers)
Create a robot on a specific street and avenue, facing a given direction with a given number of beepers.

Parameters:
street - the street on which to place the robot
avenue - the avenue on which to place the robot
direction - the direction the robot will initially face
beepers - the initial number of beepers in the beeper bag

StairClimber

public StairClimber(int street,
                    int avenue,
                    alice.kareltherobot.Direction direction,
                    int beepers,
                    org.alice.apis.moveandturn.Color color)
Create a robot on a specific street and avenue, facing a given direction with a given number of beepers and a given body color.

Parameters:
street - the street on which to place the robot
avenue - the avenue on which to place the robot
direction - the direction the robot will initially face
beepers - the initial number of beepers in the beeper bag
color - the color of this robot
Method Detail

turnRight

public void turnRight()
Robot turns 90 degrees clockwise (to its right).


climbOneStair

public void climbOneStair()
Climb a stair one "street" high and one "avenue" wide.


climbStairs

public void climbStairs()
Climb three stairs


getBeeper

public void getBeeper()
Climb the three stairs and pick the beeper.


task

public void task()
Perform the task and announce its completion.