Exemplo n.º 1
0
 public void PortaPremio()
 {
     for ( ; ;)
     {
         Thread.Sleep(rand.Next(2000));
         Premi premitemp = listapremi[rand.Next(0, listapremi.Count)];
         if (premitemp is Suppellettile)
         {
             Suppellettile s1 = (Suppellettile)premitemp;
             //Buff.Buff = s1;
             Suppellettile s2 = new Suppellettile(s1);
             Buff.Buff = s2;
         }
         else if (premitemp is GadgetElettronico)
         {
             GadgetElettronico g1 = (GadgetElettronico)premitemp;
             //Buff.Buff = g1;
             GadgetElettronico g2 = new GadgetElettronico(g1);
             Buff.Buff = g1;
         }
         else if (premitemp is AccessorioModa)
         {
             AccessorioModa a1 = (AccessorioModa)premitemp;
             //Buff.Buff = a1;
             AccessorioModa a2 = new AccessorioModa(a1);
             Buff.Buff = a1;
         }
     }
 }
 public void OttieniPremio()
 {
     for ( ; ;)
     {
         Thread.Sleep(rand.Next(6000));
         PremiTemp = Buff.Buff;
     }
 }
Exemplo n.º 3
0
 public Premi(Premi p)
 {
     Codice      = p.Codice;
     Descrizione = p.Descrizione;
     Prezzo      = p.Prezzo;
 }