Пример #1
0
 public void AddLosses(int addedLosses, HSCounter hsc)
 {
     losses += addedLosses;
     WriteLosses(losses, addedLosses);
     hsc.lostLabel.Text = "Lost: " + losses;
     CalculateWinPercentage(hsc);
 }
Пример #2
0
 // 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);
 }
Пример #3
0
 public void LoseButton_Clicked(HSCounter hsc)
 {
     losses++;
     hsc.lostLabel.Text = "Lost: " + losses;
     CalculateWinPercentage(hsc);
     WriteLosses(losses, 1);
 }
Пример #4
0
        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);
            }
        }
Пример #5
0
        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);
            }
        }
Пример #6
0
        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);
            }
        }
Пример #7
0
        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);
            }
        }
Пример #8
0
        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);
            }
        }
Пример #9
0
        // 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;
        }
Пример #10
0
 // 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);
 }
Пример #11
0
        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);
        }
Пример #12
0
 // 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);
 }
Пример #13
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.warlockbutton.Image = global::Hearthstone_Counter.Icons.WarlockIcon;
 }
Пример #14
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.hunterbutton.Image = global::Hearthstone_Counter.Icons.hunter_4;
 }
Пример #15
0
        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);
            }
        }
Пример #16
0
 private void SelectButton(HSCounter hsc)
 {
     selected = true;
     hsc.warlockbutton.Image = global::Hearthstone_Counter.Icons.WarlockIconSelected;
     DeselectOthers(hsc);
 }
Пример #17
0
 private void DeselectOthers(HSCounter hsc)
 {
     hsc.DeselectDefault();
     hsc.DeselectDruid();
     hsc.DeselectHunter();
     hsc.DeselectPaladin();
     hsc.DeselectPriest();
     hsc.DeselectShaman();
     hsc.DeselectMage();
     hsc.DeselectRogue();
     hsc.DeselectWarrior();
 }
Пример #18
0
 // Changes the background to the class' background picture
 private void ChangeBG(HSCounter hsc)
 {
     hsc.BackgroundImage = Background.warlockBG;
 }
Пример #19
0
 private void SelectButton(HSCounter hsc)
 {
     selected = true;
     hsc.priestbutton.Image = global::Hearthstone_Counter.Icons.priestSelected;
     DeselectOthers(hsc);
 }
Пример #20
0
 public AddLosses(HSCounter T)
 {
     hsc = T;
     InitializeComponent();
     this.addLossesBox.KeyPress += new KeyPressEventHandler(CheckEnter);
 }
Пример #21
0
 // Changes the background to the class' background picture
 private void ChangeBG(HSCounter hsc)
 {
     hsc.BackgroundImage = Background.priestBG;
 }
Пример #22
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.paladinbutton.Image = global::Hearthstone_Counter.Icons.PaladinIcon;
 }
Пример #23
0
        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);
            }
        }
Пример #24
0
        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);
            }
        }
Пример #25
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.roguebutton.Image = global::Hearthstone_Counter.Icons.RogueIcon;
 }
Пример #26
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.priestbutton.Image = global::Hearthstone_Counter.Icons.priestIcon;
 }
Пример #27
0
        public void ResetButton_Clicked(HSCounter hsc)
        {
            writer.ResetResults();

            wins = losses = 0;
            hsc.label1.Text = "Won: 0";
            hsc.lostLabel.Text = "Lost: 0";
            CalculateWinPercentage(hsc);
        }
Пример #28
0
        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);
            }
        }
Пример #29
0
 public void WinButton_Clicked(HSCounter hsc)
 {
     wins++;
     hsc.label1.Text = "Won: " + wins;
     CalculateWinPercentage(hsc);
     WriteWins(wins, 1);
 }
Пример #30
0
 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);
 }