Android Open Source - RussianTripleForAndroid Player






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;
//w w  w . j a v  a 2s.co  m
import java.util.Collections;
import java.util.Vector;

class Player {
  private static NoTrumpComparator cardsOrder = new NoTrumpComparator();
  
  private String name = "";

  private int score = 0;

  // TODO Create Hand class.
  private Vector<Card> hand = new Vector<Card>();

  // TODO Create CollectedTricks class.
  private Vector<Card> tricks = new Vector<Card>();

  private boolean canBid = false;
  
  public Player(String name) {
    this.name = name;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getScore() {
    return score;
  }

  public void setScore(int score) {
    this.score = score;
  }

  public Vector<Card> getHand() {
    return hand;
  }

  public void setHand(Vector<Card> hand) {
    this.hand = hand;
  }

  public Vector<Card> getTricks() {
    return tricks;
  }

  public void setTricks(Vector<Card> tricks) {
    this.tricks = tricks;
  }

  public void endBidding() {
    canBid = false;
  }
  
  public boolean isBidding() {
    return canBid;
  }
  
  public void resetRound() {
    canBid = true;
    hand.clear();
    tricks.clear();
  }

  public void recieve(Card card) {
    hand.add(card);
  }

  public void recieve(Card[] trick) {
    for (Card card : trick) {
      tricks.add(card);
    }
  }

  public void sort() {
    Collections.sort(hand, cardsOrder);
  }
}




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