Exemplo n.º 1
0
void oEvent::viewClubMembers(gdioutput &gdi, int clubId)
{
  sortRunners(ClassStartTime);
  sortTeams(ClassStartTime, 0);

  gdi.fillDown();
  gdi.dropLine();
  int nr = 0;
  int nt = 0;
  // Update teams
  for (oTeamList::iterator it = Teams.begin(); it!=Teams.end(); ++it) {
    if (it->getClubId() == clubId) {
      if (nt==0)
        gdi.addString("", 1, "Lag(flera)");
      gdi.addStringUT(0, it->getName() + ", " + it->getClass() );
      nt++;
    }
  }

  gdi.dropLine();
  // Update runners
  for (oRunnerList::iterator it = Runners.begin(); it!=Runners.end(); ++it) {
    if (it->getClubId() == clubId) {
      if (nr==0)
        gdi.addString("", 1, "Löpare:");
      gdi.addStringUT(0, it->getName() + ", " + it->getClass() );
      nr++;
    }
  }
}
Exemplo n.º 2
0
void playEM_ref(team_t* teams)
{
  static const int cInitialNumSuccessors = NUMGROUPS * 2 + NUMTHIRDS;
  static const int cTeamsPerGroup = NUMTEAMS / NUMGROUPS;
  team_t* successors[NUMGROUPS * 2 + NUMTHIRDS] = {0};
  team_t* bestThirds[NUMGROUPS];
  int g, curBestThird = 0, numSuccessors = cInitialNumSuccessors;

  // play groups
  initialize();
  for (g = 0; g < NUMGROUPS; ++g) {
    playGroup(g,
              teams + (g * cTeamsPerGroup),
              cTeamsPerGroup,
              successors + g * 2,
              successors + (numSuccessors - (g * 2) - 1),
              bestThirds + g);
  }

  // fill best thirds
  sortTeams(NUMGROUPS, bestThirds);
  for (g = 0; g < numSuccessors; ++g) {
    if (successors[g] == NULL) {
      successors[g] = bestThirds[curBestThird++];
    }
  }

  // play final rounds
  while (numSuccessors > 1) {
    playFinalRound_ref(numSuccessors / 2, successors, successors);
    numSuccessors /= 2;
  }
}