dk.itu.smds.torusman
Class LocalTorus

java.lang.Object
  extended by dk.itu.smds.torusman.LocalTorus
All Implemented Interfaces:
Torus
Direct Known Subclasses:
DistTorus

public class LocalTorus
extends java.lang.Object
implements Torus


Constructor Summary
LocalTorus(byte[][][][] grid)
          Constructor.
 
Method Summary
 Scores addPoints(byte manId, byte teamId, int points)
          Add points to team score.
 Board getBoard(Man man)
          Get a board (and indicate man has moved to this board).
 void moveTo(ManData manData, byte X, byte Y)
          Indicate that a man has moved to a new position (x,y) on board (X,Y).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalTorus

public LocalTorus(byte[][][][] grid)
Constructor.

Parameters:
grid - Initial grid data. grid[X][Y][y][x] holds data for position (x,y) in the board located at (X,Y). Note that all boards must have the same dimensions, and that each column of boards must have the same height.
Method Detail

addPoints

public Scores addPoints(byte manId,
                        byte teamId,
                        int points)
Description copied from interface: Torus
Add points to team score.

Specified by:
addPoints in interface Torus
Returns:
A table mapping teamId's to points.

getBoard

public Board getBoard(Man man)
Description copied from interface: Torus
Get a board (and indicate man has moved to this board).

Specified by:
getBoard in interface Torus
Returns:

moveTo

public void moveTo(ManData manData,
                   byte X,
                   byte Y)
Description copied from interface: Torus
Indicate that a man has moved to a new position (x,y) on board (X,Y).

Specified by:
moveTo in interface Torus