继承
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); } } }
补充