Example #1
0
 public void layoutBausenFromLoading(GameModel gameModel) {
   int round = gameModel.getState().getRound();
   int declared, achieved;
   for (int i = 0; i < 4; i++) {
     declared = gameModel.getPlayer(i).getDeclaredNo(round);
     achieved = gameModel.getPlayer(i).getAchievedNo(round);
     screen.updateBausen(i, declared, 0, true);
     for (int j = 0; j < achieved; j++) screen.updateBausen(i, declared, achieved, false);
   }
 }
Example #2
0
 public void setNames(ArrayList<String> names) {
   for (int i = 0; i < names.size(); i++) {
     if (nicknameSet[i]) continue;
     players[i].setName(names.get(i));
     screen.setPlayerName(i, names.get(i));
   }
   for (int i = names.size(); i < 4; i++) {
     if (nicknameSet[i]) continue;
     screen.setPlayerName(i, players[i].getName());
   }
   setName(pid, getStatisticsController().getName());
 }
Example #3
0
 public void setActivePlayer(int player) {
   screen.setActivePlayer(player);
   if (player == pid) {
     if (reminderTask.isScheduled()) return;
     turnReminder.scheduleTask(reminderTask, REMINDER_INTERVAL, REMINDER_INTERVAL);
   } else cancelReminder();
 }
Example #4
0
 public PlayerController(PlayerModel[] players, int pid, GameScreen screen) {
   this.screen = screen;
   this.pid = pid;
   this.players = players;
   for (int i = 0; i < 4; i++) {
     screen.setPlayerName(i, players[i].getName());
     nicknameSet[i] = false;
   }
   simulator = new GameSimulator(new AiConfig(), getWhistAiCallback(), Config.AUTOPLAY_DELAY);
 }
Example #5
0
 public void layoutCards() {
   Array<Card> cards = Pools.obtain(Array.class);
   for (int i = 0; i < 4; i++) {
     cards.clear();
     for (int c : players[i].getCards()) cards.add(getCardController().getCard(c));
     screen.playDealingAnimation(i, cards);
   }
   cards.clear();
   Pools.free(cards);
 }
Example #6
0
 @Override
 public void run() {
   getSounds().playTurnSound();
   screen.nudgePlayerCards(pid);
 }
Example #7
0
 public void animateValidCards(int player, Array<Card> cards) {
   screen.animateValidCards(player, cards);
 }
Example #8
0
 public void setName(int playerIndex, String nickname) {
   nicknameSet[playerIndex] = true;
   players[playerIndex].setName(nickname);
   screen.setPlayerName(playerIndex, nickname);
 }
Example #9
0
 public void playCard(int player, int card) {
   players[player].throwCard(card);
   screen.throwCard(player, getCardController().getCard(card));
 }
Example #10
0
 private void resetBausen() {
   screen.resetBausen();
 }
Example #11
0
 public void layoutBausen(int player, boolean reset, int round) {
   if (reset) players[player].setAchievedNo(0, round);
   screen.updateBausen(
       player, players[player].getDeclaredNo(round), players[player].getAchievedNo(round), reset);
 }
Example #12
0
 public void reset() {
   screen.resetPlayerViews();
   for (int i = 0; i < 4; i++) players[i].reset();
 }