- AbstractGrid<E> - Class in info.gridworld.grid
-
AbstractGrid
contains the methods that are common to grid
implementations.
- AbstractGrid() - Constructor for class info.gridworld.grid.AbstractGrid
-
- act() - Method in class info.gridworld.actor.Actor
-
Reverses the direction of this actor.
- act() - Method in class info.gridworld.actor.Bug
-
Moves if it can move, turns otherwise.
- act() - Method in class info.gridworld.actor.Critter
-
A critter acts by getting a list of other actors, processing that list,
getting locations to move to, selecting one of them, and moving to the
selected location.
- act() - Method in class info.gridworld.actor.Flower
-
Causes the color of this flower to darken.
- act() - Method in class info.gridworld.actor.Rock
-
Overrides the act
method in the Actor
class
to do nothing.
- Actor - Class in info.gridworld.actor
-
An Actor
is an entity with a color and direction that can act.
- Actor() - Constructor for class info.gridworld.actor.Actor
-
Constructs a blue actor that is facing north.
- ActorWorld - Class in info.gridworld.actor
-
An ActorWorld
is occupied by actors.
- ActorWorld() - Constructor for class info.gridworld.actor.ActorWorld
-
Constructs an actor world with a default grid.
- ActorWorld(Grid<Actor>) - Constructor for class info.gridworld.actor.ActorWorld
-
Constructs an actor world with a given grid.
- add(Location, Actor) - Method in class info.gridworld.actor.ActorWorld
-
Adds an actor to this world at a given location.
- add(Actor) - Method in class info.gridworld.actor.ActorWorld
-
Adds an occupant at a random empty location.
- add(Location, T) - Method in class info.gridworld.world.World
-
Adds an occupant at a given location.
- addGridClass(String) - Method in class info.gridworld.world.World
-
Adds a class to be shown in the "Set grid" menu.
- addOccupantClass(String) - Method in class info.gridworld.world.World
-
Adds a class to be shown when clicking on an empty location.
- AHEAD - Static variable in class info.gridworld.grid.Location
-
The turn angle for making no turn.
- get(Location) - Method in class info.gridworld.grid.BoundedGrid
-
- get(Location) - Method in interface info.gridworld.grid.Grid
-
Returns the object at a given location in this grid.
- get(Location) - Method in class info.gridworld.grid.UnboundedGrid
-
- getActors() - Method in class info.gridworld.actor.Critter
-
Gets the actors for processing.
- getAdjacentLocation(int) - Method in class info.gridworld.grid.Location
-
Gets the adjacent location in any one of the eight compass directions.
- getCol() - Method in class info.gridworld.grid.Location
-
Gets the column coordinate.
- getColor() - Method in class info.gridworld.actor.Actor
-
Gets the color of this actor.
- getDirection() - Method in class info.gridworld.actor.Actor
-
Gets the current direction of this actor.
- getDirectionToward(Location) - Method in class info.gridworld.grid.Location
-
Returns the direction from this location toward another location.
- getEmptyAdjacentLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
-
- getEmptyAdjacentLocations(Location) - Method in interface info.gridworld.grid.Grid
-
Gets the valid empty locations adjacent to a given location in all eight
compass directions (north, northeast, east, southeast, south, southwest,
west, and northwest).
- getGrid() - Method in class info.gridworld.actor.Actor
-
Gets the grid in which this actor is located.
- getGrid() - Method in class info.gridworld.world.World
-
Gets the grid managed by this world.
- getGridClasses() - Method in class info.gridworld.world.World
-
Gets a set of grid classes that should be used by the world frame for
this world.
- getLocation() - Method in class info.gridworld.actor.Actor
-
Gets the location of this actor.
- getMessage() - Method in class info.gridworld.world.World
-
Gets the message to be displayed in the world frame above the grid.
- getMoveLocations() - Method in class info.gridworld.actor.Critter
-
Gets a list of possible locations for the next move.
- getNeighbors(Location) - Method in class info.gridworld.grid.AbstractGrid
-
- getNeighbors(Location) - Method in interface info.gridworld.grid.Grid
-
Gets the neighboring occupants in all eight compass directions (north,
northeast, east, southeast, south, southwest, west, and northwest).
- getNumCols() - Method in class info.gridworld.grid.BoundedGrid
-
- getNumCols() - Method in interface info.gridworld.grid.Grid
-
Returns the number of columns in this grid.
- getNumCols() - Method in class info.gridworld.grid.UnboundedGrid
-
- getNumRows() - Method in class info.gridworld.grid.BoundedGrid
-
- getNumRows() - Method in interface info.gridworld.grid.Grid
-
Returns the number of rows in this grid.
- getNumRows() - Method in class info.gridworld.grid.UnboundedGrid
-
- getOccupantClasses() - Method in class info.gridworld.world.World
-
Gets a set of occupant classes that should be used by the world frame for
this world.
- getOccupiedAdjacentLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
-
- getOccupiedAdjacentLocations(Location) - Method in interface info.gridworld.grid.Grid
-
Gets the valid occupied locations adjacent to a given location in all
eight compass directions (north, northeast, east, southeast, south,
southwest, west, and northwest).
- getOccupiedLocations() - Method in class info.gridworld.grid.BoundedGrid
-
- getOccupiedLocations() - Method in interface info.gridworld.grid.Grid
-
Gets the locations in this grid that contain objects.
- getOccupiedLocations() - Method in class info.gridworld.grid.UnboundedGrid
-
- getRandomEmptyLocation() - Method in class info.gridworld.world.World
-
Gets a random empty location in this world.
- getRow() - Method in class info.gridworld.grid.Location
-
Gets the row coordinate.
- getValidAdjacentLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
-
- getValidAdjacentLocations(Location) - Method in interface info.gridworld.grid.Grid
-
Gets the valid locations adjacent to a given location in all eight
compass directions (north, northeast, east, southeast, south, southwest,
west, and northwest).
- Grid<E> - Interface in info.gridworld.grid
-
Grid
provides an interface for a two-dimensional, grid-like
environment containing arbitrary objects.