예제 #1
0
        /// <summary>
        /// Адаптер
        /// </summary>
        public static void GoAdapterRusConscriptUSA()
        {
            Serviceman serviceman = new Conscript();

            Print(serviceman.Greeting);
            Print(serviceman.CanICommand());
            Print(serviceman.CanIEquipment());
            Console.WriteLine();
            RusificatedConscriptUSA rusificated = new RusificatedConscriptUSA();

            Print(rusificated.Greeting);
            Print(rusificated.CanICommand());
            Print(rusificated.CanIEquipment());
            Console.ReadKey();
        }
예제 #2
0
파일: Example.cs 프로젝트: Konversys/PLArmy
        /// <summary>
        /// Делегирование
        /// </summary>
        public static void GoDelegateServiceman()
        {
            Serviceman serviceman;

            serviceman = new Conscript();
            serviceman.CanICommand();
            Console.WriteLine();
            serviceman.CanIEquipment();
            Console.WriteLine();
            serviceman = new ExperiencedOfficer();
            serviceman.CanICommand();
            Console.WriteLine();
            serviceman.CanIEquipment();
            Console.WriteLine();
            serviceman = new ContractTechnician();
            serviceman.CanICommand();
            Console.WriteLine();
            serviceman.CanIEquipment();
            Console.ReadKey();
        }