public void AddLosses(int addedLosses, HSCounter hsc) { losses += addedLosses; WriteLosses(losses, addedLosses); hsc.lostLabel.Text = "Lost: " + losses; CalculateWinPercentage(hsc); }
// Add results when the "Add More" button is clicked public void AddWins(int addedWins, HSCounter hsc) { wins += addedWins; WriteWins(wins, addedWins); hsc.label1.Text = "Won: " + wins; CalculateWinPercentage(hsc); }
public void LoseButton_Clicked(HSCounter hsc) { losses++; hsc.lostLabel.Text = "Lost: " + losses; CalculateWinPercentage(hsc); WriteLosses(losses, 1); }
private void ResetPaladinScore(HSCounter hsc) { Paladin paladin = new Paladin(); DialogResult paladinDialogResult = MessageBox.Show("Are you sure that you want to reset your paladin score to 0?", "Reset Paladin Score", MessageBoxButtons.YesNo); if (paladinDialogResult == DialogResult.Yes) { paladin.ResetButton_Clicked(hsc); } }
private void ResetMageScore(HSCounter hsc) { Mage mage = new Mage(); DialogResult mageDialogResult = MessageBox.Show("Are you sure that you want to reset your mage score to 0?", "Reset Mage Score", MessageBoxButtons.YesNo); if (mageDialogResult == DialogResult.Yes) { mage.ResetButton_Clicked(hsc); } }
private void ResetHunterScore(HSCounter hsc) { Hunter hunter = new Hunter(); DialogResult hunterDialogResult = MessageBox.Show("Are you sure that you want to reset your hunter score to 0?", "Reset Hunter Score", MessageBoxButtons.YesNo); if (hunterDialogResult == DialogResult.Yes) { hunter.ResetButton_Clicked(hsc); } }
private void ResetDruidScore(HSCounter hsc) { Druid druid = new Druid(); DialogResult druidDialogResult = MessageBox.Show("Are you sure that you want to reset your druid score to 0?", "Reset Druid Score", MessageBoxButtons.YesNo); if (druidDialogResult == DialogResult.Yes) { druid.ResetButton_Clicked(hsc); } }
private void ResetPriestScore(HSCounter hsc) { Priest priest = new Priest(); DialogResult priestDialogResult = MessageBox.Show("Are you sure that you want to reset your priest score to 0?", "Reset Priest Score", MessageBoxButtons.YesNo); if (priestDialogResult == DialogResult.Yes) { priest.ResetButton_Clicked(hsc); } }
// Calculates the win percentage public void CalculateWinPercentage(HSCounter hsc) { winPercentage = (double)wins / (wins + losses); if (Double.IsNaN(winPercentage)) winPercentage = 0; winPercentageString = string.Format("{0:0.0%}", winPercentage); hsc.defwinPlabel.Text = "Win %: " + winPercentageString; }
// Clicked Buttons public void WarlockButton_Clicked(HSCounter hsc) { ChangeBG(hsc); SelectButton(hsc); ReadWins(); hsc.label1.Text = "Won: " + wins; WriteWins(wins, 0); ReadLosses(); hsc.lostLabel.Text = "Lost: " + losses; WriteLosses(losses, 0); CalculateWinPercentage(hsc); }
public void ResetButton_Clicked(HSCounter hsc) { DefaultCounter dfc = new DefaultCounter(); dfc.WriteWins(dfc.Wins - wins); dfc.WriteLosses(dfc.Losses - losses); WriteWins(0, 0); WriteLosses(0, 0); wins = losses = 0; hsc.label1.Text = "Won: 0"; hsc.lostLabel.Text = "Lost: 0"; CalculateWinPercentage(hsc); }
// move all the dialog boxes to reset the score here and reduce the reset buttons to one. public void ResetScore(HSCounter hsc) { if (DefaultCounter.IsSelected()) ResetWholeScore(hsc); else if (Druid.IsSelected()) ResetDruidScore(hsc); else if (Hunter.IsSelected()) ResetHunterScore(hsc); else if (Mage.IsSelected()) ResetMageScore(hsc); else if (Paladin.IsSelected()) ResetPaladinScore(hsc); else if (Priest.IsSelected()) ResetPriestScore(hsc); else if (Rogue.IsSelected()) ResetRogueScore(hsc); else if (Shaman.IsSelected()) ResetShamanScore(hsc); else if (Warlock.IsSelected()) ResetWarlockScore(hsc); else if (Warrior.IsSelected()) ResetWarriorScore(hsc); }
public void DeselectButton(HSCounter hsc) { selected = false; hsc.warlockbutton.Image = global::Hearthstone_Counter.Icons.WarlockIcon; }
public void DeselectButton(HSCounter hsc) { selected = false; hsc.hunterbutton.Image = global::Hearthstone_Counter.Icons.hunter_4; }
private void ResetWarriorScore(HSCounter hsc) { Warrior warrior = new Warrior(); DialogResult warriorDialogResult = MessageBox.Show("Are you sure that you want to reset your warrior score to 0?", "Reset Warrior Score", MessageBoxButtons.YesNo); if (warriorDialogResult == DialogResult.Yes) { warrior.ResetButton_Clicked(hsc); } }
private void SelectButton(HSCounter hsc) { selected = true; hsc.warlockbutton.Image = global::Hearthstone_Counter.Icons.WarlockIconSelected; DeselectOthers(hsc); }
private void DeselectOthers(HSCounter hsc) { hsc.DeselectDefault(); hsc.DeselectDruid(); hsc.DeselectHunter(); hsc.DeselectPaladin(); hsc.DeselectPriest(); hsc.DeselectShaman(); hsc.DeselectMage(); hsc.DeselectRogue(); hsc.DeselectWarrior(); }
// Changes the background to the class' background picture private void ChangeBG(HSCounter hsc) { hsc.BackgroundImage = Background.warlockBG; }
private void SelectButton(HSCounter hsc) { selected = true; hsc.priestbutton.Image = global::Hearthstone_Counter.Icons.priestSelected; DeselectOthers(hsc); }
public AddLosses(HSCounter T) { hsc = T; InitializeComponent(); this.addLossesBox.KeyPress += new KeyPressEventHandler(CheckEnter); }
// Changes the background to the class' background picture private void ChangeBG(HSCounter hsc) { hsc.BackgroundImage = Background.priestBG; }
public void DeselectButton(HSCounter hsc) { selected = false; hsc.paladinbutton.Image = global::Hearthstone_Counter.Icons.PaladinIcon; }
private void ResetWholeScore(HSCounter hsc) { DefaultCounter dfc = new DefaultCounter(); DialogResult dialogResult = MessageBox.Show("Are you sure that you want to reset your score to 0?", "Reset Score", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { dfc.ResetButton_Clicked(hsc); } }
private void ResetShamanScore(HSCounter hsc) { Shaman shaman = new Shaman(); DialogResult shamanDialogResult = MessageBox.Show("Are you sure that you want to reset your shaman score to 0?", "Reset Shaman Score", MessageBoxButtons.YesNo); if (shamanDialogResult == DialogResult.Yes) { shaman.ResetButton_Clicked(hsc); } }
public void DeselectButton(HSCounter hsc) { selected = false; hsc.roguebutton.Image = global::Hearthstone_Counter.Icons.RogueIcon; }
public void DeselectButton(HSCounter hsc) { selected = false; hsc.priestbutton.Image = global::Hearthstone_Counter.Icons.priestIcon; }
public void ResetButton_Clicked(HSCounter hsc) { writer.ResetResults(); wins = losses = 0; hsc.label1.Text = "Won: 0"; hsc.lostLabel.Text = "Lost: 0"; CalculateWinPercentage(hsc); }
private void ResetRogueScore(HSCounter hsc) { Rogue rogue = new Rogue(); DialogResult rogueDialogResult = MessageBox.Show("Are you sure that you want to reset your rogue score to 0?", "Reset Rogue Score", MessageBoxButtons.YesNo); if (rogueDialogResult == DialogResult.Yes) { rogue.ResetButton_Clicked(hsc); } }
public void WinButton_Clicked(HSCounter hsc) { wins++; hsc.label1.Text = "Won: " + wins; CalculateWinPercentage(hsc); WriteWins(wins, 1); }
public void Initialization(HSCounter hsc) { Directory.CreateDirectory("Textfiles"); Directory.CreateDirectory("Textfiles/LogFiles"); DefaultButton_Clicked(hsc); ReadWins(); hsc.label1.Text = "Won: " + wins; WriteWins(wins); ReadLosses(); hsc.lostLabel.Text = "Lost: " + losses; WriteLosses(losses); }