Package cero.games

Examples of cero.games.ActionEvent


    // 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


  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

          return false;
        }
        else {
          ActionLookAtZone action = new ActionLookAtZone();
          try {
            action.playerActed(new ActionEvent(CommandLineLauncher
                .getGame(), CommandLineLauncher.getCurrentPlayer(),
                zone, null, null));
          } catch (ActionException e) {
            e.printStackTrace();
          }
          CommandLineLauncher.getGame().registerAction(action);
          currentAction = action;
        }
      }
      else if (split.length == 3) {
        Zone zone = CommandLineLauncher.getGame().getPlayers().get(
            Integer.valueOf(split[1])).getZones().get(split[2]);
        if (zone == null) {
          System.out.println("zone inconnue");
          return false;
        }
        else {
          ActionLookAtZone action = new ActionLookAtZone();
          currentAction = action;
          try {
            action.playerActed(new ActionEvent(CommandLineLauncher
                .getGame(), CommandLineLauncher.getCurrentPlayer(),
                zone, null, null));
          } catch (ActionException e) {
            e.printStackTrace();
          }
View Full Code Here

              }
            }
          }
          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 skipTurn(UnoGame g) {
    ActionSkipTurn actionSkipTurn = new ActionSkipTurn();
    try {
      actionSkipTurn.playerActed(new ActionEvent(g, this, null, null,
          null));
      g.registerAction(actionSkipTurn);
      return true;
    } catch (ActionException e) {
      e.printStackTrace();
View Full Code Here

  boolean drawACard(UnoGame g) {
    ActionPick act = new ActionPick();
    try {
      Zone stock = g.getStock();
      Zone hand = getHand();
      act.playerActed(new ActionEvent(g, this, stock, hand, null));
      g.registerAction(act);
      return true;
    } catch (ActionException e) {
      e.printStackTrace();
      return false;
View Full Code Here

    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

    ActionPlayACard action = new ActionPlayACard();
    ArrayList<Card> colcards = new ArrayList<Card>();
    colcards.add(playedcard);
    try {
      action
          .playerActed(new ActionEvent(game, player, from, to,
              colcards));
    } catch (ActionException e) {
      // there shouldn't be any problem here !
      e.printStackTrace();
    }
View Full Code Here

    colcards.add(playedcard);

    ActionPick action = new ActionPick();
    try {
      action
          .playerActed(new ActionEvent(game, player, from, to,
              colcards));
    } catch (ActionException e) {
      // there shouldn't be any problem here !
      e.printStackTrace();
    }
View Full Code Here

    Game game = CommandLineLauncher.getGame();
    Player player = CommandLineLauncher.getCurrentPlayer();

    ActionSkipTurn action = new ActionSkipTurn();
    try {
      action.playerActed(new ActionEvent(game, player, null, null, null));
    } catch (ActionException e) {
      // there shouldn't be any problem here !
      e.printStackTrace();
    }
    game.registerAction(action);
View Full Code Here

TOP

Related Classes of cero.games.ActionEvent

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.