Beispiel #1
0
        static void Main(string[] args)
        {
            Gun shotGun    = new GunClip(new ShotGun());
            Gun machineGun = new GunClip(new MachineGun());

            shotGun.Fire();
            Console.WriteLine(shotGun.Render());

            machineGun.Fire();
            Console.WriteLine(machineGun.Render());
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Gun     machinegun     = new MachineGun();
            Gun     shotgun        = new ShotGun();
            GunClip clipMachineGun = new GunClip(machinegun);

            Console.WriteLine(clipMachineGun.Render());
            clipMachineGun.Fire();
            Console.WriteLine("\n");
            Console.WriteLine(shotgun.Render());
            shotgun.Fire();
        }