Package com.svanloon.game.wizard.core.card

Examples of com.svanloon.game.wizard.core.card.Value


    int diamondStrength = 0;
    int clubStrength = 0;

    for (Card card:this.hand) {
      Suit suit = card.getSuit();
      Value value = card.getValue();
      if(suit.equals(Suit.NONE)) {
        // nothing
      } else if(suit.equals(Suit.HEART)) {
        heartStrength += value.getIndex();
      } else if(suit.equals(Suit.SPADE)) {
        spadeStrength += value.getIndex();
      } else if(suit.equals(Suit.DIAMOND)) {
        diamondStrength += value.getIndex();
      } else if(suit.equals(Suit.CLUB)) {
        clubStrength += value.getIndex();
      }
    }

    if(heartCount >= spadeCount && heartCount >= clubCount && heartCount >= diamondCount) {
      if(heartStrength >= spadeStrength && heartStrength >= clubStrength && heartStrength >= diamondStrength) {
View Full Code Here


      } else if(mp.getName().equals(MessageParamConstants.INDEX.toString())) {
        index = Integer.parseInt(mp.getValue());
      }
    }
    Suit suit = Suit.findSuitByShortName(suitShortName);
    Value value = Value.findValueByShortName(valueShortName);
    return new Card(value, suit, index);
  }
View Full Code Here

      _logger.info("suitShortName is null");
      return null;
    }
    _logger.info("suitShortName = " + suitShortName);

    Value value;
    if(valueShortName == null) {
      value = null;
      _logger.info("valueShortName is null");
    } else {
      value = Value.findValueByShortName(valueShortName);
View Full Code Here

    }
    if(suitShortName == null) {
      return null;
    }
    Suit suit = Suit.findSuitByShortName(suitShortName);
    Value value;
    if(valueShortName != null) {
      value = Value.findValueByShortName(valueShortName);
    } else {
      value = null;
    }
View Full Code Here

   */
  public void setTrump(Card card) {
    if(card == null) {
      return;
    }
    Value value = card.getValue();
    if(value == null) {
      return;
    }
    countCard(card);
    cardsDealt++;
View Full Code Here

   *
   * @param card
   */
  public void countCard(Card card) {
    Suit suit = card.getSuit();
    Value value = card.getValue();
    int index = findCardIndex(value);
    if(suit.equals(Suit.HEART)) {
      hearts[index] = 0;
    } else if(suit.equals(Suit.CLUB)) {
      clubs[index] = 0;
    } else if(suit.equals(Suit.SPADE)) {
      spades[index] = 0;
    } else if(suit.equals(Suit.DIAMOND)) {
      diamonds[index] = 0;
    } else if(suit.equals(Suit.NONE)) {
      if(value.equals(Value.WIZARD)) {
        wizard -= 1;
      } else {
        jester -= 1;
      }
    }
View Full Code Here

   * @param highCard
   * @param played
   */
  public void played(Card lead, Card highCard, Card played) {
    Suit suit = played.getSuit();
    Value value = played.getValue();
    if(suit.equals(Suit.HEART)) {
      setHearts(getHearts() + 1);
    } else if(suit.equals(Suit.SPADE)) {
      setSpades(getSpades() + 1);
    } else if(suit.equals(Suit.CLUB)) {
      setClubs(getSpades() + 1);
    } else if(suit.equals(Suit.DIAMOND)) {
      setDiamonds(getDiamonds() + 1);
    } else if(value.equals(Value.WIZARD)) {
      setWizards(getWizards() + 1);
    } else if(value.equals(Value.JESTER)) {
      setJesters(getJesters() + 1);
    }
    if(suit.equals(Suit.NONE)) {
      return;
    }
View Full Code Here

TOP

Related Classes of com.svanloon.game.wizard.core.card.Value

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.