Class StrategoPiece

java.lang.Object
  extended by StrategoPiece

public class StrategoPiece
extends java.lang.Object

This class manages data for a single piece including; it's rank, what rank to display, rank-related information, which image to use, and what textual name to use for the piece


Constructor Summary
StrategoPiece(int rank)
          This Constructor produces a Stratego Piece of the given rank
 
Method Summary
 StrategoPiece attacked(StrategoPiece otherPiece)
          This Method is called when this piece attacks another
 void deityMode()
          This Method turns on deity Mode, making it beat anything it attacks apart from another unit with deity Mode active
 java.lang.String getDisplayRank()
          This Method returns a string containing the displayed rank of the unit
 boolean isHidden()
          This Method returns true if the unit is hidden from view, false otherwise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrategoPiece

public StrategoPiece(int rank)
This Constructor produces a Stratego Piece of the given rank

Parameters:
rank - the numeric rank value for the piece to be constructed
Method Detail

getDisplayRank

public java.lang.String getDisplayRank()
This Method returns a string containing the displayed rank of the unit

Returns:
returns a string representing the rank to be displayed

attacked

public StrategoPiece attacked(StrategoPiece otherPiece)
This Method is called when this piece attacks another

Parameters:
otherPiece - the piece which this one attacked
Returns:
returns the piece which beat the other, null in the case of a tie

deityMode

public void deityMode()
This Method turns on deity Mode, making it beat anything it attacks apart from another unit with deity Mode active


isHidden

public boolean isHidden()
This Method returns true if the unit is hidden from view, false otherwise

Returns:
returns true if the unit is hidden, false otherwise