Im trying to make something like an Rpg game atm but im really stuck on something i really dont know what to do anymore i really need help it might look like a noob question but please try to answer me >.< this is the parent class
namespace ConsoleApplication1
{
class Personaje
{
public Rango Damage;
public int Defensa;
public int HP;
public int MP;
public bool Evade;
public bool Counter;
public string Nombre;
public Personaje() { }
public Personaje(Rango Damage, int Defensa, int HP, bool Evade, bool Counter, string Nombre)
{
this.Damage = Damage;
this.Defensa = Defensa;
this.HP = HP;
this.Evade = Evade;
this.Counter = Counter;
this.Nombre = Nombre;
}
}
}
this is one of the childs
namespace ConsoleApplication1
{
class Enemigo:Personaje
{
}
}
this is one of the childs and the one im having trouble with i dont know how to put the status on it
namespace ConsoleApplication1
{
class Poring:Enemigo
{
int HP = 30;
int MP = 10;
int Def = 0;
public bool Evade()
{
return false;
}
public bool Counter()
{
return false;
}
public Rango Damage()
{
Rango r = new Rango();
r.min = 10;
r.max = 15;
return r;
}
string Nombre = "Poring";
//Personaje Propiedades = new Personaje(Damage,Def, HP, Evade, Counter, Nombre);
Personaje omg = new Personaje();
}
}
If I understand your question correctly, I think you are wanting to be able to call the constructor on the parent to pass in the state of the object. You have to overload the constructor at each level of the class heirarchy.