I'm trying to create a class that holds the data for an an attack, called Attack. I also have special attacks that have more properties, and so I wanted to create a different class that inherits all of the properties of Attack while adding some more, so I created a class called Special that inherits Attack.
This is what my class structure looks like:
public class Attack { public Attack() { } public class Special : Attack { public Special() { } } } My compiler is okay with this. However, as soon as I try adding arguments to the constructor of the Attack class, for example...
public class Attack { public Attack(float damage, float staminaCost) { } public class Special : Attack { public Special() { } } } My compiler throws an error:
Line 13: There is no argument given that corresponds to the required formal parameter 'damage' of 'Attack.Attack(float, float)' I don't understand why I'm getting this error. I'm not calling Attack(float damage, float staminaCost), so why is it giving me grief over arguments? I tried un-nesting the classes but it doesn't make a difference. I need the constructor for Attack.Special to take in different arguments. Can someone help me achieve this?