SR tracking system v1 #2

Merged
Hesham merged 5 commits from Dev/SRTracking into master 2018-08-15 11:35:56 +02:00
2 changed files with 9 additions and 8 deletions
Showing only changes of commit 29805eb926 - Show all commits

View File

@ -115,6 +115,13 @@ namespace OWTrack
{
Wins.Text = tr.GetWins().ToString();
Losses.Text = tr.GetLosses().ToString();
if (tr.newSR == 0)
{
if (tr.srDiff() < 1) { srLabel.Text = tr.startSR.ToString() + " - 0"; }
else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff();
}
else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff();
srTextBox.Text = null;
File.WriteAllText(Directory.GetCurrentDirectory() + "/data.json", JsonConvert.SerializeObject(tr));
}
@ -150,13 +157,7 @@ namespace OWTrack
}
else tr.newSR = sr;
}
if (tr.newSR == 0)
{
if (tr.srDiff() < 1) { srLabel.Text = tr.startSR.ToString() + " - 0"; }
else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff();
}
else srLabel.Text = tr.startSR.ToString() + " - " + tr.srDiff();
srTextBox.Text = null;
update();
}
}
}

View File

@ -10,7 +10,7 @@ namespace OWTrack
public int wins, losses, startSR, newSR = 0;
public void Track() { }
public void reset() { wins = 0; losses = 0; }
public void reset() { wins = 0; losses = 0; startSR = 0; newSR = 0; }
public void addWin() { wins++; }
public void addLoss() { losses++; }
public void reduceWin() { wins--; }