Exemplo n.º 1
0
 @Override
 public synchronized boolean add(QueueObject to) {
   if (to == null) return false;
   playerSize += to.getNumPlayers();
   teamSize += to.getTeams().size();
   return super.add(to);
 }
Exemplo n.º 2
0
  @Override
  public boolean remove(QueueObject queueObject) {

    if (super.remove(queueObject)) {
      playerSize -= queueObject.getNumPlayers();
      teamSize -= queueObject.getTeams().size();
      return true;
    }
    return false;
  }
Exemplo n.º 3
0
 public synchronized ArenaTeam remove(ArenaTeam team) {
   Iterator<QueueObject> iter = this.iterator();
   while (iter.hasNext()) {
     QueueObject qo = iter.next();
     if (qo.hasTeam(team)) {
       iter.remove();
       playerSize -= qo.getNumPlayers();
       teamSize -= qo.getTeams().size();
       return team;
     }
   }
   return null;
 }