Ejemplo n.º 1
0
 public void AddLosses(int addedLosses, HSCounter hsc)
 {
     losses += addedLosses;
     WriteLosses(losses, addedLosses);
     hsc.lostLabel.Text = "Lost: " + losses;
     CalculateWinPercentage(hsc);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 public void LoseButton_Clicked(HSCounter hsc)
 {
     losses++;
     hsc.lostLabel.Text = "Lost: " + losses;
     CalculateWinPercentage(hsc);
     WriteLosses(losses, 1);
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 13
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.warlockbutton.Image = global::Hearthstone_Counter.Icons.WarlockIcon;
 }
Ejemplo n.º 14
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.hunterbutton.Image = global::Hearthstone_Counter.Icons.hunter_4;
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 16
0
 private void SelectButton(HSCounter hsc)
 {
     selected = true;
     hsc.warlockbutton.Image = global::Hearthstone_Counter.Icons.WarlockIconSelected;
     DeselectOthers(hsc);
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 18
0
 // Changes the background to the class' background picture
 private void ChangeBG(HSCounter hsc)
 {
     hsc.BackgroundImage = Background.warlockBG;
 }
Ejemplo n.º 19
0
 private void SelectButton(HSCounter hsc)
 {
     selected = true;
     hsc.priestbutton.Image = global::Hearthstone_Counter.Icons.priestSelected;
     DeselectOthers(hsc);
 }
Ejemplo n.º 20
0
 public AddLosses(HSCounter T)
 {
     hsc = T;
     InitializeComponent();
     this.addLossesBox.KeyPress += new KeyPressEventHandler(CheckEnter);
 }
Ejemplo n.º 21
0
 // Changes the background to the class' background picture
 private void ChangeBG(HSCounter hsc)
 {
     hsc.BackgroundImage = Background.priestBG;
 }
Ejemplo n.º 22
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.paladinbutton.Image = global::Hearthstone_Counter.Icons.PaladinIcon;
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 25
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.roguebutton.Image = global::Hearthstone_Counter.Icons.RogueIcon;
 }
Ejemplo n.º 26
0
 public void DeselectButton(HSCounter hsc)
 {
     selected = false;
     hsc.priestbutton.Image = global::Hearthstone_Counter.Icons.priestIcon;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 29
0
 public void WinButton_Clicked(HSCounter hsc)
 {
     wins++;
     hsc.label1.Text = "Won: " + wins;
     CalculateWinPercentage(hsc);
     WriteWins(wins, 1);
 }
Ejemplo n.º 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);
 }