com.asdf.utils
Class ChipOffSet

java.lang.Object
  extended by com.asdf.utils.ChipOffSet
All Implemented Interfaces:
java.lang.Comparable<ChipOffSet>

public class ChipOffSet
extends java.lang.Object
implements java.lang.Comparable<ChipOffSet>

Describes the offset of a chip instance from the center of the applicable area.


Field Summary
 int off_x
           
 int off_y
           
 int on_top
           
 int value
           
 
Constructor Summary
ChipOffSet()
          Default constructor.
ChipOffSet(int val, int offx, int offy)
          Constructor.
 
Method Summary
 void addOnTop()
          Increases topness of this chip.
 int compareTo(ChipOffSet o)
          Comparator.
 void setOnTop()
          Sets this chip to be on top.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

public int value

off_x

public int off_x

off_y

public int off_y

on_top

public int on_top
Constructor Detail

ChipOffSet

public ChipOffSet()
Default constructor. Sets value to -1 and offsets to zero.


ChipOffSet

public ChipOffSet(int val,
                  int offx,
                  int offy)
Constructor. Sets offsets and chip value to correct measures.

Parameters:
val - Value of the chip.
offx - Offset on x-axis.
offy - Offset on y-axis.
Method Detail

compareTo

public int compareTo(ChipOffSet o)
Comparator. Ensures that chip piles are shown on top.

Specified by:
compareTo in interface java.lang.Comparable<ChipOffSet>

setOnTop

public void setOnTop()
Sets this chip to be on top.


addOnTop

public void addOnTop()
Increases topness of this chip.