Пример #1
0
 private void licznik_Tick(object sender, EventArgs e)
 {
     if (!Plansza_do_gry.wdol())
     {
         if (szybka)
         {
             szybka = false;
             if (level < 11)
             {
                 Licznik.Interval = 1000 - 100 * (level - 1);
             }
             else if (level < 21)
             {
                 Licznik.Interval = 100 - 10 * (level - 1);
             }
             else
             {
                 Licznik.Interval = 10;
             }
         }
         int pkt = Plansza_do_gry.linie();
         punkty  += (pkt * pkt);
         Pkt.Text = punkty.ToString();
         if (punkty >= level * 10)
         {
             level++;
             Poziom.Text = level.ToString();
             if (level < 11)
             {
                 Licznik.Interval -= 100;
             }
             else if (level < 21)
             {
                 Licznik.Interval -= 10;
             }
             else
             {
                 Licznik.Interval = 10;
             }
         }
         figura f = nastepny.getfigura();
         if (!Plansza_do_gry.rysujfigure(5, 0, f))
         {
             Licznik.Stop();
             Licznik.Interval = 1000;
             MessageBox.Show("koniec");
             gra = false;
             f   = null;
             Plansza_do_gry.reset();
             nastepny.reset();
             level       = 1;
             punkty      = 0;
             Pkt.Text    = "0";
             Poziom.Text = "1";
             return;
         }
         nastepny.reset();
         nastepny.rysujfigure(0, 0, new figura());
     }
 }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     licznik = GameObject.Find("Manager").GetComponent <Licznik>();
     if (licznik == null)
     {
         Debug.LogError("Licznik nie zostal znaleziony.");
     }
 }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     startTime      = time;
     licznik        = GameObject.FindGameObjectWithTag("LICZNIK");   // WYSZUKUJE FUNKCJI
     licznikscript  = licznik.GetComponent <Licznik>();
     anim           = panel.GetComponent <Animator> ();
     anim.enabled   = false;
     panelDisplayed = false;
 }
Пример #4
0
    void Start()
    {
        x = false;
        iloscElementow = GameObject.FindGameObjectsWithTag("Box").Length; //POCZATKOWA ILOSC ELEMENTOW
        licznik        = GameObject.FindGameObjectWithTag("LICZNIK");     // WYSZUKUJE FUNKCJI
        licznikscript  = licznik.GetComponent <Licznik>();


        transform.rotation = Quaternion.Euler(0, 0, 0);
        transform.Rotate(0, 0, 0);
    }
        void ObslugaKlas()
        {
            //TestowaKlasa  testowaKlasa= new TestowaKlasa();
            //TestowaKlasa klsaziloscia = new TestowaKlasa(1);

            Licznik licznik = new Licznik();

            var wynik = licznik.DodajDwieLiczbyCalkowite(2, 2);

            Czlowiek czlek  = new Czlowiek("Kazio", Rasy.Zielona, new DateTime(1998, 11, 20));
            Czlowiek czlek2 = new Czlowiek("Matrynka", Rasy.Fioletowa, new DateTime(1999, 01, 10), "dkjbfkjsnfdak", "ToJestLogin");

            listaLudzi.Add(czlek);
            listaLudzi.Add(czlek2);

            listView.ItemsSource = listaLudzi;
        }
 public ActionResult Delete(Licznik licznikToDelete)
 {
     try
     {
         // TODO: Add delete logic here
         var originalLicznik = _db.Licznik.Find(licznikToDelete.Id);
         if (originalLicznik != null)
         {
             _db.Licznik.Remove(originalLicznik);
         }
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Create([Bind(Exclude = "Id")] Licznik licznikToCreate)
 {
     try
     {
         // TODO: Add insert logic here
         if (!ModelState.IsValid)
         {
             return(View());
         }
         _db.Licznik.Add(licznikToCreate);
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Edit(Licznik licznikToEdit)
 {
     try
     {
         // TODO: Add update logic here
         var originalLicznik = (from m in _db.Licznik
                                where m.Id == licznikToEdit.Id
                                select m).First();
         if (!ModelState.IsValid)
         {
             return(View(originalLicznik));
         }
         _db.Entry(originalLicznik).CurrentValues.SetValues(licznikToEdit);
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Пример #9
0
 void Start()
 {
     endfile       = GameObject.FindGameObjectWithTag("LICZNIK");
     endfilescript = endfile.GetComponent <Licznik>();
 }
Пример #10
0
 public override string ToString()
 {
     return(Licznik.ToString() + "/" + Mianownik.ToString());
 }
Пример #11
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter && !gra)
     {
         gra = true;
         Plansza_do_gry.rysujfigure(5, 0, new figura());
         nastepny.rysujfigure(0, 0, new figura());
         Licznik.Start();
     }
     else if (e.KeyCode == Keys.Left && gra && !pauza)
     {
         Plansza_do_gry.wlewo();
     }
     else if (e.KeyCode == Keys.Right && gra && !pauza)
     {
         Plansza_do_gry.wprawo();
     }
     else if (e.KeyCode == Keys.Q && gra && !pauza)
     {
         Plansza_do_gry.obroc_w_lewo();
     }
     else if ((e.KeyCode == Keys.W || e.KeyCode == Keys.Up) && gra && !pauza)
     {
         Plansza_do_gry.obroc_w_prawo();
     }
     else if (e.KeyCode == Keys.Down && gra && !pauza)
     {
         if (szybka)
         {
             Licznik.Interval = 1000 - 100 * (level - 1);
             szybka           = false;
         }
         else if (!szybka)
         {
             Licznik.Interval = 50;
             szybka           = true;
         }
     }
     else if (e.KeyCode == Keys.Escape && gra)
     {
         gra = false;
         Plansza_do_gry.reset();
         nastepny.reset();
         level       = 1;
         punkty      = 0;
         Poziom.Text = "1";
         Pkt.Text    = "0";
         Licznik.Stop();
         Licznik.Interval = 1000;
     }
     else if (e.KeyCode == Keys.Space && gra)
     {
         if (pauza)
         {
             Licznik.Start();
             pauza = false;
         }
         else
         {
             Licznik.Stop();
             pauza = true;
         }
     }
 }
Пример #12
0
        static void Main(string[] args)
        {
            /*          Filtr f1 = new Filtr();
             *        f1.Logic = "x";
             *        FiltrItem fi1 = new FiltrItem();
             *        fi1.Field = "y";
             *        fi1.Value = "c";
             *        f1.Item = fi1;
             *
             *        Filtr f2 = new Filtr();
             *        f2.Logic = "dr";
             *        FiltrItem fi2 = new FiltrItem();
             *        fi2.Value = "kr";
             *        fi2.Field = "sr";
             *        f2.Item = fi2;
             *
             *        Filtr f3 = new Filtr();
             *        f3.Logic = "baa";
             *        FiltrItem fi3 = new FiltrItem();
             *        fi3.Value = "raa";
             *        fi3.Field = "saa";
             *        f3.Item = fi3;
             *
             *       //f3.Item = new FiltrItem() {Field = "",Value - "" };
             *
             *        // string[] Filtr = new string [3]{};
             *        Filtr[] tablica;
             *        tablica = new Filtr [3];
             *        tablica[0] = f1;
             *        tablica[1] = f2;
             *        tablica[2] = f3;
             *        //tablica[3] = f3;
             *
             *        for (int i =0; i< tablica.Length; i++)
             *        {
             *            Console.WriteLine(tablica[i].Logic);
             *            Console.WriteLine(tablica[i].Item);
             *        }
             *        Console.ReadLine();
             *
             *
             *
             *
             *
             * /*
             *        Console.WriteLine("Dostępne produkty: mleko, chleb, cukier. \nAby dodać mleko wybierz 1, chleb - wybierz 2, cukier - wybierz 3");
             *        string input = Console.ReadLine();
             *        int produkt = Convert.ToInt32(input);
             *
             *        switch (produkt)
             *        {
             *            case 1:
             *                Milk milk = new Milk();
             *                milk.AddToCart();
             *                break;
             *            case 2:
             *                Bread bread = new Bread();
             *                bread.AddToCart();
             *                break;
             *
             *           default:
             *                Console.WriteLine("Wybrany produkt nie istnieje ");
             *                break;
             *                //
             *
             *        }
             *
             *
             * /*           //
             *
             *        int x = 5;
             *        if (x == 1)
             *        {
             *            Console.WriteLine("1");
             *        }
             *        else if (x == 2)
             *        {
             *            Console.WriteLine("2");
             *        }
             *
             *        else if (x == 3)
             *        {
             *            Console.WriteLine("3");
             *        }
             *
             *        else if (x == 4)
             *        {
             *            Console.WriteLine("4");
             *            Console.WriteLine("4");
             *            Console.WriteLine("4");
             *        }
             *
             *        //default
             *        else
             *        {
             *            Console.WriteLine("Nic nie zostało wybrane");
             *        }
             *
             *
             *
             *        if (x < 5)
             *        {
             *            Console.WriteLine("<5");
             *        }
             *        else if (x > 5)
             *        {
             *            Console.WriteLine(">5");
             *        }
             *
             *        //default
             *        else
             *        {
             *            Console.WriteLine("Nic nie zostało wybrane");
             *        }
             *
             *        //
             *        //enum - Cars {Audi,Opel}  / case Cars.Audi
             *
             *        int z = 11;
             *        switch (z)
             *        {
             *            case 1:
             *                Plus plus = new Plus();
             *                plus.Add(5, 6);
             *                break;
             *
             *            case 2:
             *                Minus minus = new Minus();
             *                minus.Subtract(10, 3);
             *                break;
             *
             *            default:
             *
             *                Console.WriteLine("Brak");
             *                break;
             *        }
             *
             *        List<string>
             *        {
             *            11,22,33,88
             *        };
             *
             *        //
             *
             *        List<int> list = new List<int>()
             *        {
             *            11,22,33,88
             *        };
             *
             *
             *        foreach (int elementKolekcji in list)
             *        {
             *            Console.WriteLine(elementKolekcji);
             *        }
             *       /* for (int = 0, int < List.Count; int++)
             *
             *        { Console.WriteLine (List [1])}*/
            //



            Glass bootle1 = new Glass(name: "Butelka", color: "Biała");


            Glass bootle2 = new Glass(name: "Butla", color: "Zielona");

            Beer bottle1 = new Beer(color: "Green");
            Beer bottle2 = new Beer(color: "Red");

            Rower bike1 = new Rower(name: "Stary");
            Rower bike2 = new Rower(name: "Nowy", model: 3);
            Rower bike3 = new Rower(name: " mały ", color: "żółty ", model: 1);


            Bmx bmx = new Bmx();

            Kalkulator licznik = new Kalkulator();

            Licznik letnik = new Licznik();


            bottle1.WriteLine();
            bottle2.WriteLine();
            bike1.Start();
            bike2.Stop();
            bike3.Write();
            bmx.Drive(name: "Rowerek", time: 5, color: "Red");
            bmx.Drive(5, "Rowerek", "Red");
            licznik.Wylicz(5, 10);

            letnik.LataLicz();

            int i = 1;
            int y = 2;

            i = y;
            y = 3;

            Console.WriteLine(bootle1.Name, bootle1.Color);
            Console.WriteLine(bootle2.Name, bootle2.Color);
            Console.WriteLine(i);
            Console.WriteLine(y);
            Console.WriteLine();

            Console.ReadLine();
        }
Пример #13
0
        public void Start()
        {
            Console.WriteLine("Nowe połączenie");

            _licznik       = new Licznik(this);
            _licznikThread = new Thread(_licznik.Start);
            _licznikThread.Start();

            while (aktywny)
            {
                if (!_tcpAdapter.DaneDostepne())
                {
                    continue;
                }
                _licznik.Reset();
                _licznik.Wstrzymaj();


                switch (_tcpAdapter.OdbierzKomende())
                {
                case WspolnyInterfejs.Komendy.LOGOWANIE:
                    logowanie();
                    break;

                case WspolnyInterfejs.Komendy.REJESTRACJA:
                    rejestracja();
                    break;

                case WspolnyInterfejs.Komendy.LISTA:
                    lista();
                    break;

                case Komendy.NOWY_WATEK:
                    nowyWatek();
                    break;

                case WspolnyInterfejs.Komendy.WYSLIJ_WATEK:
                    wyslijWatek();
                    break;

                case Komendy.ZAPISZ_POST:
                    zapiszPost();
                    break;

                case Komendy.OBSERWUJ_WATEK:
                    obserwujWatek();
                    break;

                case Komendy.UTRZYMAJ:
                    Console.WriteLine("Utrzymaj");
                    break;

                default:
                    Console.WriteLine("Default");
                    break;
                }

                _licznik.Wznow();
            }
            Console.WriteLine("Zakończono połączenie");

            _tcpAdapter.Close();
            ZarzadcaWatkami.Instancja().UsunObserwatora(this);
        }