private void btnVirement_Click(object sender, EventArgs e)
        {
            int i = cbxDebiteur.SelectedIndex;
            int j = cbxCredite.SelectedIndex;

            CompteBancaire CB;

            CB = monAgence.LesComptes.ElementAt(i);
            Boolean rep;

            rep = CB.debiterCompte(Decimal.Parse(txbVirement.Text));
            if (rep == true)
            {
                CompteBancaire CB2;
                CB2 = monAgence.LesComptes.ElementAt(j);
                CB2.crediterCompte(Decimal.Parse(txbVirement.Text));

                lblMessageVirement.Text      = "Le compte a été débité";
                lblMessageVirement.ForeColor = Color.Green;
            }
            else
            {
                lblMessageVirement.Text      = "Impossible de debiter le compte le montant dépasse le solde du compte";
                lblMessageVirement.ForeColor = Color.Red;
            }
        }
 public void InvincibleCode()
 {
     if (PlayerPrefs.GetInt("BlueNumber") > 0)
     {
         BluePotionParticle.SetActive(true);
         CB2.SetActive(true);
         StartCoroutine(StopInvincibleCode());
         PlayerPrefs.SetInt("BlueNumber", PlayerPrefs.GetInt("BlueNumber") - 1);
     }
 }
    /* IEnumerator StopInvincibleCode()
     * {
     *   yield return new WaitForSeconds(8f);
     *   BluePotionParticle.SetActive(false);
     *   CB2.SetActive(false);
     * }*/

    IEnumerator StopInvincibleCode()
    {
        float time = 8f;

        while (time > 0)
        {
            SoundManager.instance.BlueSoundPlay();
            yield return(new WaitForSeconds(1f));

            time--;
        }

        BluePotionParticle.SetActive(false);
        CB2.SetActive(false);
    }
Beispiel #4
0
    static void Main(string[] args)
    {
        var a1  = new CA1();
        var a11 = new CA11();
        var a2  = new CA2();
        var b1  = new CB1();
        var b2  = new CB2();

        MD.Foo(a1, b1);
        MD.Foo(a2, b1);
        MD.Foo(a1, b2);
        MD.Foo(a2, b2);
        MD.Foo(a11, b1);
        MD.Foo(a11, b2);
    }
Beispiel #5
0
 static void Foo(CA11 a, CB2 b)
 {
     Console.WriteLine("CA11 CB2");
 }