summaryrefslogtreecommitdiff
path: root/Aktywator/ChooseTournament.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Aktywator/ChooseTournament.cs')
-rw-r--r--Aktywator/ChooseTournament.cs20
1 files changed, 14 insertions, 6 deletions
diff --git a/Aktywator/ChooseTournament.cs b/Aktywator/ChooseTournament.cs
index 2bc2ded..734b191 100644
--- a/Aktywator/ChooseTournament.cs
+++ b/Aktywator/ChooseTournament.cs
@@ -10,8 +10,8 @@ namespace Aktywator
{
public partial class ChooseTournament : Form
{
- private Tournament[] turns;
- public Tournament chosenTournament;
+ private MySQLTournament[] turns;
+ public MySQLTournament chosenTournament;
public ChooseTournament()
{
@@ -20,10 +20,10 @@ namespace Aktywator
private void ChooseTournament_Load(object sender, EventArgs e)
{
- List<Tournament> list = Tournament.getTournaments();
- turns = new Tournament[list.Count];
+ List<MySQLTournament> list = MySQLTournament.getTournaments();
+ turns = new MySQLTournament[list.Count];
int c = 0;
- foreach (Tournament t in list)
+ foreach (MySQLTournament t in list)
{
turns[c++] = t;
listBox.Items.Add(t.ToString());
@@ -34,7 +34,15 @@ namespace Aktywator
{
if (listBox.SelectedIndex >= 0)
{
- chosenTournament = turns[listBox.SelectedIndex];
+ switch (turns[listBox.SelectedIndex].type)
+ {
+ case Tournament.TYPE_PARY:
+ chosenTournament = new ParyTournament(turns[listBox.SelectedIndex].name);
+ break;
+ case Tournament.TYPE_TEAMY:
+ chosenTournament = new TeamyTournament(turns[listBox.SelectedIndex].name);
+ break;
+ }
Close();
}
}