Android Open Source - RussianTripleForAndroid No Trump Comparator






From Project

Back to project page RussianTripleForAndroid.

License

The source code is released under:

GNU General Public License

If you think the Android project RussianTripleForAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package eu.veldsoft.russian.triple;
/*from  w  w  w. jav  a2 s . co m*/
import java.util.Comparator;

public class NoTrumpComparator implements Comparator<Card> {

  @Override
  public int compare(Card lhs, Card rhs) {
    if (lhs.getSuit().getOrder() > rhs.getSuit().getOrder()) {
      return -1;
    } else if (lhs.getSuit().getOrder() < rhs.getSuit().getOrder()) {
      return +1;
    } else {
      if (lhs.getRank().getPoints() > rhs.getRank().getPoints()) {
        return -1;
      } else if (lhs.getRank().getPoints() < rhs.getRank().getPoints()) {
        return +1;
      }
    }

    return 0;
  }
}




Java Source Code List

eu.veldsoft.russian.triple.AIBidder.java
eu.veldsoft.russian.triple.Bid.java
eu.veldsoft.russian.triple.Board.java
eu.veldsoft.russian.triple.Card.java
eu.veldsoft.russian.triple.ComputerPlayer.java
eu.veldsoft.russian.triple.Deck.java
eu.veldsoft.russian.triple.GameActivity.java
eu.veldsoft.russian.triple.HumanPlayer.java
eu.veldsoft.russian.triple.NoTrumpComparator.java
eu.veldsoft.russian.triple.Player.java
eu.veldsoft.russian.triple.State.java
eu.veldsoft.russian.triple.Util.java