Example #1
0
        private void buttonAzione_Click(object sender, EventArgs e)
        {
            if (Globals.listProdottiNegozio.Count == 0 || ProdottiFiniti())
            {
                Globals.statoGioco = 1;

                /*if (Globals.Livello == 1)
                 *
                 *  Negozio2.enabledClick = false;*/

                mappa = new Mappa();
                this.Close();
                mappa.ShowDialog();
                //mappa.animazioneFabbricaDaFuori();

                /*mgz = new Magazzino();
                 * this.Close();
                 * mgz.ShowDialog();*/
            }
            else
            {
                Globals.statoGioco = 3;
                mappa = new Mappa();
                this.Close();       //chiude il negozio
                mappa.ShowDialog();

                /*cln = new Cliente();
                 * this.Close();
                 * cln.ShowDialog();*/
            }
        }
Example #2
0
 private void riprendi_Click(object sender, EventArgs e)
 {
     Globals.global_rnd = new Random(Environment.TickCount);
     mappa = new Mappa();
     mappa.ShowDialog();
     Globals.newGame = false;
     this.Close();
 }
Example #3
0
        private void button_TornaNegozio_MouseClick(object sender, MouseEventArgs e)
        {
            aggiorna_lista_prodotti();
            Globals.soldiDopo = Globals.GetSoldiPortafoglio();

            /*NonSo ns = new NonSo();
            ns.ShowDialog();
            this.Close();*/

            Globals.statoGioco = 0;
            this.Close();
            mappa = new Mappa();
            mappa.ShowDialog();

            //negozio = new Negozio2();
            //negozio.ShowDialog();

            System.Console.WriteLine("SONO NELLA FABBRICA E CLICCO NEGOZIO");
            //Globals.stampaProdottiNegozio();
            System.Console.WriteLine("PRODOTTI STAMPATI");
        }
Example #4
0
 private void buttonMappa_Click(object sender, EventArgs e)
 {
     mappa = new Mappa();
     this.Close();
     mappa.ShowDialog();
 }
Example #5
0
        private void onClick(object sender, EventArgs e)
        {
            if (sender is Button)
            {
                if (timer1 != null)
                {
                    timer1.Stop();
                }

                if (timer2 != null)
                {
                    timer2.Stop();
                }

                this.SuspendLayout();
                textBox.Hide();
                this.ResumeLayout(false);

                switch (((Button)sender).Name)
                {
                case "negozio":

                    //if(Globals.statoGioco == 5)
                    //{
                    //  this.Close();
                    //}

//                        else
//                      {
                    this.pictureBox3.Visible = false;

                    if (!HomePage.newGame)
                    {
                        animFabNeg();
                    }

                    else
                    {
                        HomePage.newGame = false;
                    }

                    pictureBox2.Visible = false;
                    this.Close();

                    /* if(Globals.statoGioco == 0 || !Globals.visualizzaDialogo)
                     * {
                     *   ngz2 = new Negozio2();
                     *   ngz2.ShowDialog();
                     * }
                     *
                     * else
                     * {
                     *   ngz1 = new Negozio1();
                     *   ngz1.ShowDialog();
                     * }*/

                    if (Globals.visualizzaDialogo)
                    {
                        if (Globals.Livello == 6)
                        {
                            ngz3 = new Negozio3();
                            ngz3.ShowDialog();
                        }
                        else
                        {
                            ngz1 = new Negozio1();
                            ngz1.ShowDialog();
                        }
                    }

                    else
                    {
                        ngz2 = new Negozio2();
                        ngz2.ShowDialog();
                    }
                    //                    }

                    break;

                case "fabbrica":

                    this.pictureBox3.Visible = false;
                    animNegFab();
                    mgzz = new Fabbrica();
                    this.Close();
                    mgzz.ShowDialog();

                    break;

                case "cliente1":

                    this.pictureBox3.Visible = false;

                    if (Globals.statoGioco == 3)
                    {
                        //Globals.statoGioco = 2;
                        Globals.statoGioco = 5;
                        animClNeg1();
                        cl = new Cliente();
                        this.Close();
                        cl.ShowDialog();
                    }

                    break;

                case "cliente2":

                    this.pictureBox3.Visible = false;

                    if (Globals.statoGioco == 3)
                    {
                        //Globals.statoGioco = 2;
                        Globals.statoGioco = 5;
                        animClNeg2();
                        cl = new Cliente();
                        this.Close();
                        cl.ShowDialog();
                    }

                    break;

                case "cliente3":

                    this.pictureBox3.Visible = false;

                    if (Globals.statoGioco == 3)
                    {
                        //Globals.statoGioco = 2;
                        Globals.statoGioco = 5;
                        animClNeg3();
                        cl = new Cliente();
                        this.Close();
                        cl.ShowDialog();
                    }

                    break;

                case "bHome":

                    Globals.newGame = false;
                    pagIniz         = new HomePage();
                    this.Close();
                    pagIniz.ShowDialog();

                    break;

                case "bChiamaCliente":

                    Globals.statoGioco = 3;
                    Mappa mappa = new Mappa();
                    this.Close();
                    mappa.ShowDialog();
                    //animazioneClienteDaFuori();

                    break;

                case "bEsci":

                    Application.Exit();

                    break;
                }

                this.Close();
            }
        }
Example #6
0
        private void buttonAzione_Click(object sender, EventArgs e)
        {
            if (Globals.listProdottiNegozio.Count == 0 || ProdottiFiniti())
            {
                Globals.statoGioco = 1;

                /*if (Globals.Livello == 1)

                    Negozio2.enabledClick = false;*/

                mappa = new Mappa();
                this.Close();
                mappa.ShowDialog();
                //mappa.animazioneFabbricaDaFuori();
                /*mgz = new Magazzino();
                this.Close();
                mgz.ShowDialog();*/
            }
            else
            {
                Globals.statoGioco = 3;
                mappa = new Mappa();
                this.Close();       //chiude il negozio
                mappa.ShowDialog();

                /*cln = new Cliente();
                this.Close();
                cln.ShowDialog();*/

            }
        }
Example #7
0
 private void buttonMappa_Click(object sender, EventArgs e)
 {
     mappa = new Mappa();
     this.Close();
     mappa.ShowDialog();
 }
Example #8
0
        private void riprendi_Click(object sender, EventArgs e)
        {
	    Globals.global_rnd = new Random(Environment.TickCount);
            mappa = new Mappa();
            mappa.ShowDialog();
            Globals.newGame = false;
            this.Close();
        }
Example #9
0
        private void onClick(object sender, EventArgs e)
        {            
            if (sender is Button)
            {                
                if(timer1 != null)

                    timer1.Stop();

                if (timer2 != null)
                
                    timer2.Stop();

                this.SuspendLayout();
                textBox.Hide();
                this.ResumeLayout(false);

                switch (((Button)sender).Name)
                {
                    case "negozio":

                        //if(Globals.statoGioco == 5)
                        //{
                          //  this.Close();
                        //}

//                        else
  //                      {
                            this.pictureBox3.Visible = false;

                            if (!HomePage.newGame)
                            {
                                animFabNeg();
                            }

                            else

                                HomePage.newGame = false;

                            pictureBox2.Visible = false;
                            this.Close();

                           /* if(Globals.statoGioco == 0 || !Globals.visualizzaDialogo)
                            {
                                ngz2 = new Negozio2();
                                ngz2.ShowDialog();
                            }

                            else
                            {
                                ngz1 = new Negozio1();
                                ngz1.ShowDialog();
                            }*/

                            if (Globals.visualizzaDialogo)
                            {
                                if (Globals.Livello == 6)
                                {
                                    ngz3 = new Negozio3();
                                    ngz3.ShowDialog();
                                }
                                else
                                {
                                    ngz1 = new Negozio1();
                                    ngz1.ShowDialog();
                                }
                            }

                            else
                            {
                                ngz2 = new Negozio2();
                                ngz2.ShowDialog();
                            }
    //                    }

                        break;

                    case "fabbrica":

                        this.pictureBox3.Visible = false;
                        animNegFab();
                        mgzz = new Fabbrica();
                        this.Close();
                        mgzz.ShowDialog();

                        break;

                    case "cliente1":

                        this.pictureBox3.Visible = false;
           
                        if (Globals.statoGioco == 3)
                        {
                            //Globals.statoGioco = 2;
                            Globals.statoGioco = 5;
                            animClNeg1();
                            cl = new Cliente();
                            this.Close();
                            cl.ShowDialog();
                        }

                        break;

                    case "cliente2":

                        this.pictureBox3.Visible = false;
            
                        if (Globals.statoGioco == 3)
                        {
                            //Globals.statoGioco = 2;
                            Globals.statoGioco = 5;
                            animClNeg2();
                            cl = new Cliente();
                            this.Close();
                            cl.ShowDialog();
                        }

                        break;

                    case "cliente3":

                        this.pictureBox3.Visible = false;
            
                        if (Globals.statoGioco == 3)
                        {
                            //Globals.statoGioco = 2;
                            Globals.statoGioco = 5;
                            animClNeg3();
                            cl = new Cliente();
                            this.Close();
                            cl.ShowDialog();
                        }

                        break;

                    case "bHome":

                        Globals.newGame = false;
                        pagIniz = new HomePage();
                        this.Close();
                        pagIniz.ShowDialog();

                        break;

                    case "bChiamaCliente":

                        Globals.statoGioco = 3;
                        Mappa mappa = new Mappa();
                        this.Close();
                        mappa.ShowDialog();
                        //animazioneClienteDaFuori();

                        break;

                    case "bEsci":

                        Application.Exit();

                        break;
                }

                this.Close();
            }
        }