Package cero.games.base

Examples of cero.games.base.ActionPlayYourCards


    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));
    } catch (ActionException ex) {
      ex.printStackTrace();
    }
View Full Code Here


  public void roundStart(RoundEvent event) {
    playTopStockCard((Game) event.getGame());
  }

  private void playTopStockCard(Game game) {
    ActionPlayYourCards act = new ActionPlayACard();
    Collection<Card> cards = new ArrayList<Card>();
    cards.add(getZones().get("stock").getSortedList().get(0));
    try {
      act.playerActed(new ActionEvent(game, this,
          getZones().get("stock"), getZones().get("current"), cards));
    } catch (ActionException e) {
      e.printStackTrace();
    }
    game.registerAction(act);
View Full Code Here

      else
        return false;

      for (Card card : from.getSortedList()) {
        if (card.getCardId() == Integer.valueOf(arg[2])) {
          ActionPlayYourCards action = null;
          for (Action act : game.getActions()) {
            if (act instanceof ActionPlayYourCards) {
              //FIXME : et si y'a plusieurs ActionplayCards ? et bah plouf ! => il faut utiliser les modules  :)
              try {
                action = (ActionPlayYourCards) act.getClass()
                    .newInstance();
              } catch (Exception e) {
                e.printStackTrace();
              }
            }
          }
          cards.add(card);
          try {
            action.playerActed(new ActionEvent(game,
                CommandLineLauncher.getCurrentPlayer(), from,
                to, cards));
          } catch (ActionException e) {
            System.out.println("error during playing cards");
          }
View Full Code Here

 
  boolean playACard(UnoGame g, Card c) {
    if (c != null) {
      Collection<Card> cards = new ArrayList<Card>();
      cards.add(c);
      ActionPlayYourCards act = new ActionPlayACard();
      try {
        act.playerActed(new ActionEvent(g, this, getHand(), g.getTalon(), cards));
        g.registerAction(act);
        return true;
      } catch (ActionException e) {
        e.printStackTrace();
        return false;
View Full Code Here

TOP

Related Classes of cero.games.base.ActionPlayYourCards

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.