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
-
objects
- A list of the beepers and blocks in the world entity.
-
WorldEntity(String)
-
-
addBeepers(int, int, int)
- Adds the given number of beepers to the world entity.
-
addBlock(int, int)
- Adds one block to the world entity.
-
addWall(int, int, int, int)
- Adds the individual blocks of a wall to the
Vector.
-
define(Node, RobotWorld)
- Defines a new world entity from a branch of the abstract syntax
tree.
-
getObjects()
- A wrapper for
Vector.elements().
objects
private Vector objects
- A list of the beepers and blocks in the world entity.
WorldEntity
public WorldEntity(String inName) throws NameLengthException
getObjects
public Enumeration getObjects()
- A wrapper for
Vector.elements().
addBlock
private void addBlock(int x,
int y) throws BadCoordException
- Adds one block to the world entity.
addBeepers
private void addBeepers(int x,
int y,
int count) throws BadCoordException, BadCountException
- Adds the given number of beepers to the world entity.
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.
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.