Пример #1
0
        static void Main(string[] args)
        {
            //Person xm, xn;
            //xm = new Person();
            //xm.Value = 6;
            //xn = xm;
            //Console.WriteLine(xn.Value);
            //xn.Value = 9;
            //Console.WriteLine(xm.Value);

            //Console.WriteLine(xm.Add(4, 7));
            //Console.WriteLine(xm.Multiply(5, 7));
            //Console.ReadKey();

            //BinaryTreeNode<int> tree = new BinaryTreeNode<int>("0");//rootNode
            //BinaryTreeNode<int> n01 = tree.CreateAndJoinLeft("01");
            //BinaryTreeNode<int> n02 = tree.CreateAndJoinRight("02");
            //BinaryTreeNode<int> n011 = n01.CreateAndJoinLeft("011");
            //BinaryTreeNode<int> n012 = n01.CreateAndJoinRight("012");
            //BinaryTreeNode<int> n021 = n02.CreateAndJoinLeft("021");
            //BinaryTreeNode<int> n0211 = n021.CreateAndJoinLeft("0211");
            //BinaryTreeNode<int> n0212 = n021.CreateAndJoinRight("0212");

            ////遍历输出
            //tree.Traversal();

            //Program p = new Program();
            //p.BinaryTree();

            Profession p = new Profession();

            p.StartCombat(new Priest());
            p.StartCombat(new Rogue());
            p.StartCombat(new Mage());

            Zoo zoo = new Zoo();

            zoo.Show(new Dog());
            zoo.Show(new Cat());
            zoo.Show(new Monkey());
        }