zinger.nibbles
Class Field.GridMirror

java.lang.Object
  |
  +--zinger.nibbles.Field.GridMirror
Enclosing class:
Field

public final class Field.GridMirror
extends java.lang.Object


Field Summary
 SpaceOccupant[][] grid
          Representation of the real grid that is stored in the field object.
private  Field.GridChange lastChange
           
 
Constructor Summary
Field.GridMirror()
           
 
Method Summary
(package private)  void gridChange(int x, int y, SpaceOccupant occupant)
           
 void validate()
          Goes through the string of changes and updates the grid accordingly.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

grid

public final SpaceOccupant[][] grid
Representation of the real grid that is stored in the field object. Because this two-dimensional array can be altered programmatically without the knowledge of this instance, it should only be shared by objects that trust each other. Whenever this object is accessed, validate method should be called.
See Also:
validate()

lastChange

private Field.GridChange lastChange
Constructor Detail

Field.GridMirror

public Field.GridMirror()
Method Detail

gridChange

void gridChange(int x,
                int y,
                SpaceOccupant occupant)
Parameters:
x - X-coordinate of the grid space
y - Y-coordinate of the grid space
occupant - present space occupant

validate

public void validate()
Goes through the string of changes and updates the grid accordingly.
See Also:
grid