Package cero.games.base

Examples of cero.games.base.ZoneFile


  public void roundStart(RoundEvent e) {
    UnoGame game = (UnoGame) e.getGame();

    // moves all the cards in the zone "stock"
    ZoneFile stockZone = game.getStock();
    game.getTalon().moveCards(stockZone);

    for (cero.games.Player player : game.getPlayers())
      for (Zone zone : player.getZones())
        zone.moveCards(stockZone);
   
    // shuffling
    stockZone.setSorter(new ShuffleSorter());
    stockZone.sort();

    // dealing
    for (int i = 0; i < cardDealtNumber; i++)
      for (Player p : game.getPlayers())
        stockZone.moveCard(stockZone.getTopCard(),
            ((UnoPlayer) p).getHand());
    // Put the first card not black on the Talon

    while ((CardUno) stockZone.getTopCard() instanceof BlackUnoCard) {
      stockZone.moveCard(stockZone.getTopCard(), game.getStock());
    }

    //remise à zéro de l'ordre des joueurs
    game.getPlayers().sort(null);
    //passage au joueur précédent
    game.getPlayers().sort(this);

    // play the top card of the talon zone
    Collection<Card> cards = new ArrayList<Card>();
    cards.add(stockZone.getTopCard());
    ActionPlayYourCards act = new ActionPlayACard();
    try {
      act.playerActed(new ActionEvent(game, game.getPlayers()
          .getSortedList().get(0), game.getStock(), game.getTalon(),
          cards));
View Full Code Here


      }
    }
  }

  private void makePlayerDraw(Player p, int quantity) {
    ZoneFile stock = ((UnoGame) getGame()).getStock();
    ZoneHand hand = ((UnoPlayer) p).getHand();
    stock.drawCards(hand, quantity);
  }
View Full Code Here

TOP

Related Classes of cero.games.base.ZoneFile

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.