Example #1
0
        private void frmHayvanCiftligi_Load(object sender, EventArgs e)
        {
            tavuk = new Tavuk();
            ordek = new Ordek();
            inek  = new Inek();
            keci  = new Keci();

            birKereTavuk = true;
            birKereOrdek = true;
            birKereInek  = true;
            birKereKeci  = true;

            timer.Enabled  = true;
            update.Enabled = true;

            saniye = 0;
            kasa   = 0;
        }
Example #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Interval = 1000;
            timer1.Start();
            zaman++;
            label12.Text = Convert.ToString(zaman);
            Tavuk tavuk = new Tavuk();
            Ordek ordek = new Ordek();
            Inek  inek  = new Inek();
            Keci  keci  = new Keci();

            tavuk.Can = progressBar1.Value;
            ordek.Can = progressBar2.Value;
            inek.Can  = progressBar3.Value;
            keci.Can  = progressBar4.Value;

            if (tavuk.Can >= 2)
            {
                progressBar1.Value = progressBar1.Value - tavuk.CanAzalimi();
                tavuk.Can          = progressBar1.Value;
                label17.Text       = "CANLI";
            }
            else if (tavuk.Can < 2)
            {
                progressBar1.Value = 0;
                tavuk.Can          = progressBar3.Value;
                label17.Text       = "ÖLÜ";
                tavuk.Yasam();
            }

            if (ordek.Can >= 3)
            {
                progressBar2.Value = progressBar2.Value - ordek.CanAzalimi();
                ordek.Can          = progressBar2.Value;
                label18.Text       = "CANLI";
            }
            else if (ordek.Can < 3)
            {
                progressBar2.Value = 0;
                ordek.Can          = progressBar3.Value;
                label18.Text       = "ÖLÜ";
                ordek.Yasam();
            }

            if (inek.Can >= 8)
            {
                progressBar3.Value = progressBar3.Value - inek.CanAzalimi();
                inek.Can           = progressBar3.Value;
                label19.Text       = "CANLI";
            }
            else if (inek.Can < 8)
            {
                progressBar3.Value = 0;
                inek.Can           = progressBar3.Value;
                label19.Text       = "ÖLÜ";
                inek.Yasam();
            }

            if (keci.Can >= 6)
            {
                progressBar4.Value = progressBar4.Value - keci.CanAzalimi();
                keci.Can           = progressBar4.Value;
                label16.Text       = "CANLI";
            }
            else if (keci.Can < 6)
            {
                progressBar4.Value = 0;
                keci.Can           = progressBar3.Value;
                label16.Text       = "ÖLÜ";
                keci.Yasam();
            }

            if (progressBar1.Value != 0)
            {
                int tavukUrunu = zaman / tavuk.uretimMiktari;
                label6.Text = tavukUrunu.ToString();
            }

            if (progressBar2.Value != 0)
            {
                int ordekUrunu = zaman / ordek.uretimMiktari;
                label8.Text = ordekUrunu.ToString();
            }

            if (progressBar3.Value != 0)
            {
                int inekUrunu = zaman / inek.uretimMiktari;
                label7.Text = inekUrunu.ToString();
            }

            if (progressBar4.Value != 0)
            {
                int keciUrunu = zaman / keci.uretimMiktari;
                label9.Text = keciUrunu.ToString();
            }

            label13.Text = kasa.ToString();
        }