コード例 #1
0
ファイル: Program.cs プロジェクト: Jeffiy/DesignPatterns
        static void Main(string[] args)
        {
            Player b = new Forwards("巴奈尔");
            b.Attack();

            Player m = new Guards("麦克格雷迪");
            m.Attack();

            Player y = new Translator("姚明");
            y.Attack();
            y.Defense();

            Console.Read();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: benxuhuang/designPatterns
        static void Main(string[] args)
        {
            Player b = new Forwards("巴迪");

            b.Attack();

            Player m = new Guards("麥克");

            m.Attack();

            Player ym = new Translator("姚明");

            ym.Attack();
            ym.Defense();
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Player b = new Forwards("巴蒂尔");

            b.Attack();

            Player m = new Guards("陈佩斯");

            m.Attack();

            Player ym = new Translator("姚明");

            ym.Attack();
            ym.Defense();
            Console.ReadKey();
        }
コード例 #4
0
        static void Main(string[] args)
        {
            Player a = new Forwards("James");

            a.Attack();

            Player b = new Guards("Kobe");

            b.Attack();

            Player c = new Translator("姚明");

            c.Attack();
            c.Defense();
            Console.ReadKey();
        }
コード例 #5
0
        static void Main(string[] args)
        {
            Player b = new Forwards("巴奈尔");

            b.Attack();

            Player m = new Guards("麦克格雷迪");

            m.Attack();

            Player y = new Translator("姚明");

            y.Attack();
            y.Defense();

            Console.Read();
        }
コード例 #6
0
        static void Main(string[] args)
        {
            //适配器模式

            Target target = new Adpter();

            target.Request();



            Player paly = new Forwards("乔丹");

            paly.Addach();


            paly = new Translation("姚明");
            paly.Addach();
            paly.Defense();

            Console.Read();
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: ElvinChan/DesignPattern
        static void Main(string[] args)
        {
            #region 基本用法(Basic.cs)
            Target target = new Adapter();
            target.Request();
            #endregion

            #region 具体实例(Example.cs)
            Player b = new Forwards("巴蒂尔");
            b.Attack();

            Player m = new Guards("麦克格雷迪");
            m.Attack();

            //Player ym = new Center("姚明");
            Player ym = new Translator("姚明");
            ym.Attack();
            ym.Defense();

            Console.Read();
            #endregion
        }
コード例 #8
0
        static void Main(string[] args)
        {
            #region 基本用法(Basic.cs)
            Target target = new Adapter();
            target.Request();
            #endregion

            #region 具体实例(Example.cs)
            Player b = new Forwards("巴蒂尔");
            b.Attack();

            Player m = new Guards("麦克格雷迪");
            m.Attack();

            //Player ym = new Center("姚明");
            Player ym = new Translator("姚明");
            ym.Attack();
            ym.Defense();

            Console.Read();
            #endregion
        }
コード例 #9
0
        static void Main(string[] args)
        {
            Player playerA = new Forwards("Jordan");

            playerA.Attack();
            Player playerB = new Guards("Iverson");

            playerB.Attack();

            Player ym = new Translator("姚明");

            ym.Attack();
            ym.Defense();

            Console.WriteLine("\n");

            Target target = new Adapter();

            target.Request();

            Console.ReadLine();
        }