WatorWorld
Class WrappedBoundedGrid<E>

java.lang.Object
  extended by WatorWorld.AbstractGrid<E>
      extended by WatorWorld.BoundedGrid<E>
          extended by WatorWorld.WrappedBoundedGrid<E>
All Implemented Interfaces:
Grid<E>

public class WrappedBoundedGrid<E>
extends BoundedGrid<E>


Constructor Summary
WrappedBoundedGrid(int rows, int cols)
           
 
Method Summary
 ArrayList<Location> getValidAdjacentLocations(Location loc)
          Gets the valid locations adjacent to a given location in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
 
Methods inherited from class WatorWorld.BoundedGrid
get, getNumCols, getNumRows, getOccupiedLocations, isValid, put, remove
 
Methods inherited from class WatorWorld.AbstractGrid
getEmptyAdjacentLocations, getNeighbors, getOccupiedAdjacentLocations, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappedBoundedGrid

public WrappedBoundedGrid(int rows,
                          int cols)
Method Detail

getValidAdjacentLocations

public ArrayList<Location> getValidAdjacentLocations(Location loc)
Description copied from interface: Grid
Gets the valid locations adjacent to a given location in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
Precondition: loc is valid in this grid

Specified by:
getValidAdjacentLocations in interface Grid<E>
Overrides:
getValidAdjacentLocations in class AbstractGrid<E>
Parameters:
loc - a location in this grid
Returns:
an array list of the valid locations adjacent to loc in this grid