Beispiel #1
0
        private void btnNazad_Click(object sender, EventArgs e)
        {
            frmGlavna f = new frmGlavna(this.Location.X, this.Location.Y);

            f.Show();
            this.Hide();
        }
Beispiel #2
0
        private void OsveziTekst(String Text) //OVO JE GLAVNI LOOP ZA IGRU... TREBALO BI
        {
            if (client == null)
            {
                return;
            }

            List <int> indeksi = client.Provera(Text.ToCharArray());

            char[] chGlavna = txtGlavna.Text.ToCharArray();

            txtGlavna.Text = "";
            if (indeksi.Count > 0)
            {
                for (int i = 0, j = 0, k = 0; i < chGlavna.Length; i++)
                {
                    if (Char.IsLower(chGlavna [i]))
                    {
                        txtGlavna.Text += chGlavna [i];
                        k++;
                        continue;
                    }
                    if (j < indeksi.Count && (i - k) == indeksi [j])
                    {
                        j++;
                        txtGlavna.Text += Text;
                    }
                    else
                    {
                        txtGlavna.Text += chGlavna [i];
                    }
                }
            }

            PrikaziZivot();
            EStatusIgre status = client.Status();

            if (status == EStatusIgre.IGRA_ZAVRSENA_POBEDA)
            {
                Timer.Stop();
                frmUnosRekorda dialog = new frmUnosRekorda(client);
                dialog.ShowDialog();
                frmGlavna f = new frmGlavna(this.Location.X, this.Location.Y);
                Close();
                f.Show();
            }
            else if (status == EStatusIgre.IGRA_ZAVRSENA_PORAZ)
            {
                Timer.Stop();
                txtGlavna.Text = client.Resenje().ToString();
                txtGlavna.Text = "";
                char[] ca = client.Resenje();
                foreach (char c in ca)
                {
                    txtGlavna.Text += c;
                }
            }
        }
Beispiel #3
0
        private void OsveziTekst(String Text) //OVO JE GLAVNI LOOP ZA IGRU... TREBALO BI
        {
			if (client == null)
				return;
				
			List<int> indeksi = client.Provera (Text.ToCharArray ());
			char[] chGlavna = txtGlavna.Text.ToCharArray ();

			txtGlavna.Text = "";
			if (indeksi.Count > 0)
			{
				for (int i = 0, j = 0, k = 0; i < chGlavna.Length; i++)
				{
					if (Char.IsLower (chGlavna [i]))
					{
						txtGlavna.Text += chGlavna [i];
						k++;
						continue;
					}
					if (j < indeksi.Count && (i - k) == indeksi [j])
					{
						j++;
						txtGlavna.Text += Text;
					} else
					{
						txtGlavna.Text += chGlavna [i];
					}
				}
			}

			PrikaziZivot ();
			EStatusIgre status = client.Status ();
			if (status == EStatusIgre.IGRA_ZAVRSENA_POBEDA)
			{
				Timer.Stop ();
				frmUnosRekorda dialog = new frmUnosRekorda (client);
				dialog.ShowDialog ();
				frmGlavna f = new frmGlavna (this.Location.X, this.Location.Y);
				Close ();
				f.Show ();
			} else if (status == EStatusIgre.IGRA_ZAVRSENA_PORAZ)
			{
				Timer.Stop ();
				txtGlavna.Text = client.Resenje ().ToString ();
				txtGlavna.Text = "";
				char[] ca = client.Resenje ();
				foreach (char c in ca)
					txtGlavna.Text += c;
			}
        }
Beispiel #4
0
 private void AnimacijaIz_Tick(object sender, EventArgs e)
 {
     if (btnNazad.Location.X >= -208)
     {
         btnNazad.Location    = new Point(btnNazad.Location.X - 5, btnNazad.Location.Y);
         lblAutori.Location   = new Point(lblAutori.Location.X + 5, lblAutori.Location.Y);
         linkAdresa.Location  = new Point(linkAdresa.Location.X + 5, linkAdresa.Location.Y);
         lblProjekat.Location = new Point(lblProjekat.Location.X + 5, lblProjekat.Location.Y);
     }
     else
     {
         AnimacijaIz.Stop();
         frmGlavna f = new frmGlavna(this.Location.X, this.Location.Y);
         f.Show();
         this.Hide();
     }
 }
Beispiel #5
0
 private void AnimacijaIz_Tick(object sender, EventArgs e)
 {
     if (btnNazad.Location.X <= -212)
     {
         btnNazad.Location    = new Point(btnNazad.Location.X - 4, btnNazad.Location.Y);
         btnOsvezi.Location   = new Point(btnOsvezi.Location.X + 5, btnOsvezi.Location.Y);
         lblRekordi.Location  = new Point(lblRekordi.Location.X + 5, lblRekordi.Location.Y);
         dataRekordi.Location = new Point(dataRekordi.Location.X + 5, dataRekordi.Location.Y);
     }
     else
     {
         AnimacijaIz.Stop();
         frmGlavna f = new frmGlavna(this.Location.X, this.Location.Y);
         f.Show();
         this.Hide();
     }
 }
Beispiel #6
0
 private void AnimacijaIz_Tick(object sender, EventArgs e)
 {
     if (btnNazad.Location.X >= -208)
     {
         btnNazad.Location = new Point(btnNazad.Location.X - 5, btnNazad.Location.Y);
         lblAutori.Location = new Point(lblAutori.Location.X + 5, lblAutori.Location.Y);
         linkAdresa.Location = new Point(linkAdresa.Location.X + 5, linkAdresa.Location.Y);
         lblProjekat.Location = new Point(lblProjekat.Location.X + 5, lblProjekat.Location.Y);
     }
     else
     {
         AnimacijaIz.Stop();
         frmGlavna f = new frmGlavna(this.Location.X, this.Location.Y);
         f.Show();
         this.Hide();
     }
     
 }
Beispiel #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (client.Status() == EStatusIgre.IGRA_AKTIVNA)
            {
                if (MessageBox.Show("Da li ste sigurni da zelite da zavrsite ovu partiju?", "Izlazak iz partije", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    string resejne = new string (client.Resenje());
                    OsveziTekst(resejne);
                }
                else
                {
                    return;
                }
            }

            if (MessageBox.Show("Da li ste sigurni da zelite da izadjete iz igre.", "Povratak na prethodni meni", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                frmGlavna f = new frmGlavna(this.Location.X, this.Location.Y);
                this.Close();
                f.Show();
            }
        }
Beispiel #8
0
 private void btnNazad_Click(object sender, EventArgs e)
 {
     frmGlavna f = new frmGlavna(this.Location.X, this.Location.Y);
     f.Show();
     this.Hide();
 }
Beispiel #9
0
 private void AnimacijaIz_Tick(object sender, EventArgs e)
 {
     if (btnNazad.Location.X <= -212)
     {
         btnNazad.Location = new Point(btnNazad.Location.X - 4, btnNazad.Location.Y);
         btnOsvezi.Location = new Point(btnOsvezi.Location.X + 5, btnOsvezi.Location.Y);
         lblRekordi.Location = new Point(lblRekordi.Location.X + 5, lblRekordi.Location.Y);
         dataRekordi.Location = new Point(dataRekordi.Location.X + 5, dataRekordi.Location.Y);
     }
     else
     {
         AnimacijaIz.Stop();
         frmGlavna f = new frmGlavna(this.Location.X, this.Location.Y);
         f.Show();
         this.Hide();
     }
 }
Beispiel #10
0
        private void button1_Click(object sender, EventArgs e)
        {
			if (client.Status () == EStatusIgre.IGRA_AKTIVNA)
			{
				if (MessageBox.Show ("Da li ste sigurni da zelite da zavrsite ovu partiju?", "Izlazak iz partije", MessageBoxButtons.YesNo) == DialogResult.Yes)
				{
					string resejne = new string (client.Resenje ());
					OsveziTekst (resejne);
				} else
					return;
			}

			if (MessageBox.Show ("Da li ste sigurni da zelite da izadjete iz igre.", "Povratak na prethodni meni", MessageBoxButtons.YesNo) == DialogResult.Yes)
			{
				frmGlavna f = new frmGlavna (this.Location.X, this.Location.Y);
				this.Close ();
				f.Show ();
			}
        }