Package cero.games.uno

Examples of cero.games.uno.CardUno


  private static class ColorSorter implements Sorter<Card> {
    public List<Card> sort(Collection<Card> data) {
      List<Card> result = new ArrayList<Card>();
      int[] colorindexes = new int[5];
      CardUno realcard;
      for (Card c : data) {
        realcard = (CardUno) c;
        result.add(colorindexes[realcard.getColor()], c);
        for (int i = realcard.getColor() + 1; i < 5; i++)
          colorindexes[i]++;
      }
      return result;
    }
View Full Code Here


  }

  private static void print(Collection collection) {
    if (collection != null)
      for (Object obj : collection){
        CardUno card = (CardUno) obj;
        System.out.println(card.toString()+" [Active color : "+CardUno.colors[card.getActiveColor()]+"]");
      }
  }
View Full Code Here

      // Couleur demandée :
      sayAskedColor();

      // Derniere carte posée
      ZonePile talon = game.getTalon();
      CardUno topcard = (CardUno) talon.getTopCard();
      SoundManager.playSound(new WaveSound("wav/gui/dernierecarte.wav",
          false));
      SoundManager.playSound(new WaveSound("wav/cards/"
          + topcard.getCardName() + ".wav", false));

      // Nombre de cartes des joueurs

      for (Player player : game.getPlayers()) {
        String string = player.getPlayerName() + " : ";
View Full Code Here

    /**
     * Says the asked color.
     */
    private void sayAskedColor() {
      ZonePile talon = game.getTalon();
      CardUno topcard = (CardUno) talon.getTopCard();
      String couleur = "";
      if (topcard.getActiveColor() == CardUno.BLEU)
        couleur = "bleu";
      else if (topcard.getActiveColor() == CardUno.ROUGE)
        couleur = "rouge";
      else if (topcard.getActiveColor() == CardUno.VERT)
        couleur = "vert";
      else if (topcard.getActiveColor() == CardUno.JAUNE)
        couleur = "jaune";
      else if (topcard.getActiveColor() == CardUno.NOIR)
        couleur = "noir";

      SoundManager.playSound(new WaveSound("wav/gui/couleurdemande.wav",
          false));
      SoundManager.playSound(new WaveSound("wav/gui/" + couleur + ".wav",
View Full Code Here

    List<GraphicsCard> gCList = this.getGCardList();
   
    if ((gCList.size() > 0) && (gCList.get(gCList.size() - 1) != null)){
      GraphicsCard shownCard = gCList.get(gCList.size() - 1);
     
      CardUno card = (CardUno) shownCard.getCard();
      int colorInt = card.getActiveColor();
      Color color = new Color(0,155,255);
     
      switch(colorInt){
     
      case CardUno.BLEU:
View Full Code Here

TOP

Related Classes of cero.games.uno.CardUno

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.