继承

 using System;

namespace c继承
{
    class Program
    {
        public static void Main(string[] args)
        {
            Boss boss=new Boss();
            boss.AI();
            
            // TODO: Implement Functionality Here
            
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
    }
}
//
using System;

namespace c继承
{
    /// <summary>
    /// Description of Type2.
    /// </summary>
    public class Type2:Enemy
    {
    
    }
}
//
using System;

namespace c继承
{
    /// <summary>
    /// Description of Class1.
    /// </summary>
    public class Type1:Enemy
    {
        
    }
}
//
using System;

namespace c继承
{
    /// <summary>
    /// Description of Boss.
    /// </summary>
    public class Boss:Enemy
    {
        public void Attack()
        {
            
        Console.WriteLine("Boss正在进行攻击");
        
        }
    }
}
//
using System;

namespace c继承
{
    class Program
    {
        public static void Main(string[] args)
        {
            Boss boss=new Boss();
            boss.AI();
            
            // TODO: Implement Functionality Here
            
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
    }
}

 补充

 

posted @ 2018-11-05 21:24  逐梦武威  阅读(99)  评论(0编辑  收藏  举报