Exemple #1
0
  public Flags createTeamFlags() {

    List<Flag> tflag = new LinkedList<Flag>();
    tflag.add(new Flag("TeamName", String.class));
    tflag.add(new Flag("Institution", String.class));

    try {
      for (int i = 0; i < (Integer) Settings.getInstance().getFlagValue("speakersPerTeam"); i++)
        tflag.add(new MultFlag("Speaker", i, ISpeaker.class));
      for (int i = 1; i <= (Integer) Settings.getInstance().getFlagValue("numRounds"); i++)
        tflag.add(new MultFlag("Result", i, Integer.class));
    } catch (Exception e) {
      return null;
    }

    Flags teamFlags =
        new Flags(tflag.toArray(new Flag[tflag.size()]), Team.getBuiltInStatic(), null);

    Team.setFlags(teamFlags);

    return teamFlags;
  }
Exemple #2
0
  @Override
  public boolean loadData() {
    Settings settings = Settings.getInstance();

    try {
      settings.setFlagValue("numRounds", 4);
      settings.setFlagValue("speakersPerTeam", 2);
      settings.setFlagValue("numTeams", 12);
      settings.setFlagValue("teamsPerSide", 2);
    } catch (StoreException e) {
      e.printStackTrace();
      return false;
    }

    return true;
  }
Exemple #3
0
  public Flags createSpeakerFlags() {
    List<Flag> sflag = new LinkedList<Flag>();

    sflag.add(new Flag("SpeakerName", String.class));

    try {
      for (int i = 1; i <= (Integer) Settings.getInstance().getFlagValue("numRounds"); i++)
        sflag.add(new MultFlag("Result", i, Integer.class));
    } catch (Exception e) {
      return null;
    }

    Flags speakerFlags =
        new Flags(sflag.toArray(new Flag[sflag.size()]), Speaker.getBuiltInStatic(), null);

    Speaker.setFlags(speakerFlags);

    return speakerFlags;
  }