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; }
@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; }
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; }