写一个例子
基类敌人类(hp speed 方法 :move ai )派生出来两个类
boos类
type1enemy类
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace test_05_继承
{
internal class Program
{
static void Main(string[] args)
{
Boss boss1= new Boss(100,10000,20);//创建boss类
boss1.Print();*
}
}
}
----------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace test_05_继承
{
internal class Enemy
{
protected int hp;
protected int speed;
public void AI()
{
Console.WriteLine("AI");
}
public void Move()
{
Console.WriteLine("Move");
}
}
}
-----------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace test_05_继承
{
internal class Tpye1Enemy:Enemy
{
}
}
标签:c#,Generic,namespace,System,继承,internal,Collections,using
From: https://www.cnblogs.com/lijie-lijie/p/18324240