예제 #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);
 }
예제 #2
0
  @Override
  public boolean remove(QueueObject queueObject) {

    if (super.remove(queueObject)) {
      playerSize -= queueObject.getNumPlayers();
      teamSize -= queueObject.getTeams().size();
      return true;
    }
    return false;
  }
예제 #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;
 }