glassfrog.players
Class PositionComparator

java.lang.Object
  extended by glassfrog.players.PositionComparator
All Implemented Interfaces:
java.util.Comparator<Player>

public class PositionComparator
extends java.lang.Object
implements java.util.Comparator<Player>

Compares the positions of the players. Position 0 is first to act

Author:
jdavidso

Constructor Summary
PositionComparator()
           
 
Method Summary
 int compare(Player o1, Player o2)
          Compares the positions of the players.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

PositionComparator

public PositionComparator()
Method Detail

compare

public int compare(Player o1,
                   Player o2)
Compares the positions of the players. Used to sort the players by position relative to the dealer

Specified by:
compare in interface java.util.Comparator<Player>
Parameters:
o1 - Player 1
o2 - Player 2
Returns:
0 for a tie, Negative if Player 1 acts before Player 2 and Positive if Player 2 acts before Player 1