Class StrategoBoard

java.lang.Object
  extended by StrategoBoard

public class StrategoBoard
extends java.lang.Object

This class manages data for a 10 by 10 board of stratego pieces


Constructor Summary
StrategoBoard()
           
 
Method Summary
 void deityMode(int row, int column)
          This Method sets the unit in the given square into deity mode
 void flagReveal()
          This Method sets both flags to not be hidden.
 StrategoPiece getPiece(int row, int column)
          This Method returns the piece at the given location
 boolean isOccupied(int row, int column)
          This Method returns true if the given square is empty, else false
 boolean pathIsOccupied(int row1, int column1, int row2, int column2)
          This Method returns true if a straight path from square 1 to square 2 is empty, else it returns false.
 void placePiece(int row, int column, StrategoPiece piece)
          This Method places the given piece at the given location
 void removePiece(int row, int column)
          This Method removes the piece from the given location
 void reset()
          This Method empties out the entire board
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrategoBoard

public StrategoBoard()
Method Detail

getPiece

public StrategoPiece getPiece(int row,
                              int column)
This Method returns the piece at the given location

Parameters:
row - the row to get the piece from
column - the column to get the piece from
Returns:
returns the piece in that row and column

placePiece

public void placePiece(int row,
                       int column,
                       StrategoPiece piece)
This Method places the given piece at the given location

Parameters:
row - the row to get the piece from
column - the column to get the piece from
piece - the piece to place at the row and column

removePiece

public void removePiece(int row,
                        int column)
This Method removes the piece from the given location

Parameters:
row - the row to remove the piece from
column - the column to remove the piece from

isOccupied

public boolean isOccupied(int row,
                          int column)
This Method returns true if the given square is empty, else false

Parameters:
row - the row of the square to check
column - the column of the square to check

pathIsOccupied

public boolean pathIsOccupied(int row1,
                              int column1,
                              int row2,
                              int column2)
This Method returns true if a straight path from square 1 to square 2 is empty, else it returns false.

Parameters:
row1 - the row of the starting square.
column1 - the column of the starting square.
row2 - the row of the ending square.
column2 - the column of the ending square.

reset

public void reset()
This Method empties out the entire board


deityMode

public void deityMode(int row,
                      int column)
This Method sets the unit in the given square into deity mode

Parameters:
row - the row of the unit to deify
column - the column of the unit to deify

flagReveal

public void flagReveal()
This Method sets both flags to not be hidden.