Beispiel #1
0
 public static Boolean ExistDirtyCard(CardGameBean game) {
   for (CardDeckBean site : game.getDeck().values()) {
     for (CardBean card : site.getCardMap().values()) {
       if (card.getDirtyFlag() > 0) return true;
     }
   }
   return false;
 }
Beispiel #2
0
 public static void GenCardSource(CardGameBean gameBean, int playerID) {
   CardDeckBean site = gameBean.getDeck().get(playerID);
   if (site == null) return;
   List<Integer> Cards = new ArrayList<Integer>();
   for (int i = 0; i < _cardStore.length; i++) {
     Cards.add(_cardStore[i]);
   }
   //		List<Integer> washCards = WashCard(Cards);
   //		site.setCardSource(washCards);
   site.setCardSource(Cards);
 }
Beispiel #3
0
 public static void InitCardSite(CardGameBean gameBean, int playerID) {
   GenCardSource(gameBean, playerID);
   CardDeckBean site = gameBean.getDeck().get(playerID);
   if (site == null) return;
   site.setEmptyCardMap();
   gameBean.AddCard(playerID, 20001, CardBean.HERO_ZONE_ID);
   for (int i = 0; i < Constants.DEFAULT_HAND_CARD_NUM; i++) {
     Integer cardID = site.getDrawCard();
     gameBean.AddCard(playerID, cardID, CardBean.HAND_ZONE_ID);
   }
 }
Beispiel #4
0
 public static void InitGameCard(CardGameBean newGame) {
   for (CardDeckBean site : newGame.getDeck().values()) {
     InitCardSite(newGame, site.getPlayerID());
   }
 }
Beispiel #5
0
  /*
  public static void quitGame(GameBean gameBean, BattleFarmExtension extension)
  {
  	// Remove game from gameList
  	extension.getGames().remove(gameBean);

  	// Destroy game objects
  	gameBean.setPlayers(null);
  	gameBean.setBaseGameMapBean(null);

  	extension.trace("Battlefarm: game " + gameBean.getId() + " destroyed");

  	gameBean = null;
  }
  */
  public static void RemovePlayer(int gameID, int playerID) {
    CardGameBean game = GameLobbyBean.GetInstance().getGameMap().get(gameID);
    if (game == null) return;
    if (game.getDeck().get(playerID) == null) return;
    game.setNeedClose();
  }
Beispiel #6
0
 public static Boolean ExistGameSupport(CardGameBean game, int which, int type) {
   for (CardDeckBean deck : game.getDeck().values()) {
     if (SupportCardBsn.ExistDeckSupport(deck, which, type) == true) return true;
   }
   return false;
 }