-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anatoly Anischenko
committed
Dec 1, 2020
1 parent
d46066c
commit 506e1d2
Showing
3 changed files
with
100 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,36 @@ | ||
package generator.objects; | ||
|
||
import generator.Generator; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class JudgeTeam { | ||
private static int cnt = 1; | ||
|
||
private static final String INSERT_SCRIPT_TEMPLATE = "SELECT insert_judge_team('%s', %d);"; | ||
|
||
public int judge_team_id; | ||
public ArrayList<Integer> judges; | ||
public int championship_id; | ||
|
||
private JudgeTeam(ArrayList<Integer> judges, int championship_id) { | ||
this.judge_team_id = cnt++; | ||
this.judges = judges; | ||
this.championship_id = championship_id; | ||
} | ||
|
||
public static JudgeTeam generate(ArrayList<Integer> judges, int championship_id) { | ||
return insert(judges, championship_id); | ||
} | ||
|
||
public static JudgeTeam insert(ArrayList<Integer> judges, int championship_id) { | ||
Generator.addScript(String.format(INSERT_SCRIPT_TEMPLATE, | ||
Generator.getIntArray(judges), | ||
championship_id)); | ||
|
||
JudgeTeam newJudgeTeam = new JudgeTeam(judges, championship_id); | ||
Generator.judgeTeams.add(newJudgeTeam); | ||
|
||
return newJudgeTeam; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters