public Duel accept(ArenaPlayer player) {
    Duel d = getChallengedDuel(player);
    if (d != null) {
      d.accept(player);
      if (d.isReady()) {
        /// Do a final check to see if they have completed all the duel options
        if (!checkWager(d)) return null;

        ArenaTeam t = d.getChallengerTeam();
        ArenaTeam t2 = d.makeChallengedTeam();
        List<ArenaTeam> teams = new ArrayList<ArenaTeam>();
        teams.add(t);
        teams.add(t2);
        JoinOptions jo = new JoinOptions();
        jo.setMatchParams(d.getMatchParams());
        jo.setJoinLocation(player.getLocation());
        if (d.getOptions().hasOption(DuelOption.ARENA)) {
          jo.setArena((Arena) d.getOptions().getOptionValue(DuelOption.ARENA));
        }
        Matchup m = new Matchup(d.getMatchParams(), teams, jo);
        m.addArenaListener(this);
        formingDuels.remove(d);
        ongoingDuels.put(m, d);
        MatchTeamQObject mo = new MatchTeamQObject(m);
        BattleArena.getBAController().addMatchup(mo);
      }
    }
    return d;
  }
Esempio n. 2
0
 public Arena getArena() {
   return jp.getArena();
 }
Esempio n. 3
0
 public long getJoinTime() {
   return jp.getJoinTime();
 }
Esempio n. 4
0
 public QueueObject(JoinOptions jp) {
   this.jp = jp;
   matchParams = jp.getMatchParams();
 }