Class WorldEntity

java.lang.Object
   |
   +----Symbol
           |
           +----WorldEntity

public class WorldEntity
extends Symbol
Represents a new world entity defined by a RoBOTL programmer.

Author:
Peter Sagerson, petersag@wpi.edu

Variable Index

 o objects
A list of the beepers and blocks in the world entity.

Constructor Index

 o WorldEntity(String)

Method Index

 o addBeepers(int, int, int)
Adds the given number of beepers to the world entity.
 o addBlock(int, int)
Adds one block to the world entity.
 o addWall(int, int, int, int)
Adds the individual blocks of a wall to the Vector.
 o define(Node, RobotWorld)
Defines a new world entity from a branch of the abstract syntax tree.
 o getObjects()
A wrapper for Vector.elements().

Variables

 o objects
 private Vector objects
A list of the beepers and blocks in the world entity.

Constructors

 o WorldEntity
 public WorldEntity(String inName) throws NameLengthException

Methods

 o getObjects
 public Enumeration getObjects()
A wrapper for Vector.elements().

 o addBlock
 private void addBlock(int x,
                       int y) throws BadCoordException
Adds one block to the world entity.

 o addBeepers
 private void addBeepers(int x,
                         int y,
                         int count) throws BadCoordException, BadCountException
Adds the given number of beepers to the world entity.

 o addWall
 private void addWall(int xStart,
                      int yStart,
                      int Direction,
                      int length) throws BadCoordException
Adds the individual blocks of a wall to the Vector.

Throws: BadCoordException
if the wall extends beyond 0 in either direction.
 o define
 public void define(Node root,
                    RobotWorld world)
Defines a new world entity from a branch of the abstract syntax tree. The root node should be the node for the WorldEntity statement.

Parameters:
root - should be an ASTWorldEntity
world - allows access to RobotWorld.eval() and error reporting.