我尝试使用此方法,使我的角色,但我得到的错误: 无障碍不一致:返回type'consoleapplication1.Enemigo”比 方法少入店‘consoleapplication1.poringbuilder.makeporing()’ 了我第一次得到这个错误,我真的不知道该怎么做,我已经尝试了很多不同的方式,但我得到了同样的错误PLZ帮助>。 <C#中不一致的可访问性意味着什么?
namespace ConsoleApplication1
{
public static class PoringBuilder
{
public static Enemigo MakePoring()
{
return new Enemigo(15, 0, 30,15, false, false,"Poring");
}
}
这是另一个类
namespace ConsoleApplication1
{
class Enemigo:Personaje
{
public Enemigo(int Damage, int Defensa, int HP,int MP, bool Evade, bool Counter, string Nombre)
: base(Damage, Defensa, HP,MP, Evade, Counter, Nombre)
{
}
}
}
这是我所有的类
namespace ConsoleApplication1
{
class Personaje
{
public int Damage;
public int Defensa;
public int HP;
public int MP;
public bool Evade;
public bool Counter;
public string Nombre;
//public Personaje() { }
public Personaje(int Damage, int Defensa, int HP,int MP, bool Evade, bool Counter, string Nombre)
{
this.Damage = Damage;
this.Defensa = Defensa;
this.HP = HP;
this.MP = MP;
this.Evade = Evade;
this.Counter = Counter;
this.Nombre = Nombre;
}
}
}
和IM使用它的主程序这样
List<Enemigo> EnemigosNoob = new List<Enemigo>();
EnemigosNoob.Add(PoringBuilder.MakePoring());
的父
我希望即时通讯足够的>。 <我试过让它公开,它没有解决任何问题>。 <
对不起朱丽叶,好像StackOverflow上需要一个更好的源代码控制系统。 – 2009-12-13 01:33:06
btw其JULIO!不是朱丽叶! XD – Makenshi 2009-12-13 01:40:04
不是问题,尤里;) – Juliet 2009-12-13 01:52:35