summaryrefslogtreecommitdiff
path: root/Aktywator/MainForm.cs
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-10-24 14:57:21 +0200
committeremkael <emkael@tlen.pl>2018-10-24 14:57:21 +0200
commit5b9b179e9623c8b6935976ac537b2f9a1996486a (patch)
tree8da92804841daeb24639b8b232ef5c3f40281aca /Aktywator/MainForm.cs
parent68b73444035103941c45e24a96b05f6cf40334c9 (diff)
Scoring type configuration support
Fixes michzimny/aktywator#43
Diffstat (limited to 'Aktywator/MainForm.cs')
-rw-r--r--Aktywator/MainForm.cs30
1 files changed, 29 insertions, 1 deletions
diff --git a/Aktywator/MainForm.cs b/Aktywator/MainForm.cs
index ecf52c5..0f456ea 100644
--- a/Aktywator/MainForm.cs
+++ b/Aktywator/MainForm.cs
@@ -26,6 +26,8 @@ namespace Aktywator
public static Version requiredBCSVersion;
public static Version requiredFWVersion;
+ private Dictionary<RadioButton, int> _scoringType;
+
public MainForm()
{
InitializeComponent();
@@ -34,6 +36,11 @@ namespace Aktywator
private void MainForm_Load(object sender, EventArgs e)
{
if (!MySQL.getConfigured()) (new MysqlSettings()).ShowDialog();
+ this._scoringType = new Dictionary<RadioButton, int>();
+ this._scoringType.Add(this.rbMatchpoints, 1);
+ this._scoringType.Add(this.rbIMPCavendish, 2);
+ this._scoringType.Add(this.rbIMPButler, 3);
+ this._scoringType.Add(this.rbIMPTeams, 4);
}
private void MainForm_Shown(object sender, EventArgs e)
@@ -97,7 +104,6 @@ namespace Aktywator
{
syncToolStrip.Visible = false;
namesPanel.Visible = false;
- this.rbMatchpoints.Checked = true;
}
this.WindowState = FormWindowState.Normal;
@@ -744,5 +750,27 @@ namespace Aktywator
this.rbIMPTeams.Enabled = xShowPercentage.Checked && teamsTournament;
}
+ internal int getScoringType()
+ {
+ if (this.xShowPercentage.Checked)
+ {
+ foreach (KeyValuePair<RadioButton, int> type in this._scoringType)
+ {
+ if (type.Key.Checked)
+ {
+ return type.Value;
+ }
+ }
+ }
+ return 0;
+ }
+
+ internal void setScoringType(int scoringType)
+ {
+ foreach (KeyValuePair<RadioButton, int> type in this._scoringType)
+ {
+ type.Key.Checked = (type.Value == scoringType);
+ }
+ }
}
}