private static Product NieuweSigaar() { string kleur = "Rood"; double prijs = random.Next(10, 50); double aantalseconden = random.Next(3, 10); Klapsigaar sigaar = new Klapsigaar(kleur, prijs, aantalseconden); return(sigaar); }
private static void Klappen() { foreach (Product product in producten) { Klapsigaar sigaar = product as Klapsigaar; if (sigaar is Klapsigaar) { double teller = sigaar.AantalSeconden; while (teller > 0) { Console.Write("{0}...", teller); teller--; } Console.Write("BAM!\n"); } } Console.WriteLine(""); }