Ok, well what you currently have I have no idea how to describe. It is inheritance, but not a practical use of inheritance.
It sounds like what you are wanting to do is create a class where you have variables that can be used throughout your project. There are a few tidbits about doing this. Namely, in order to be invoking calls on the same object (that contains the variables) throughout your project, you will have to pass that object around your project. Those variables (such as combat) will be passed alongside the object.
Now, I think what you have assumed is that you can simply say:
Code java:
//Assuming the MethodProvider is passed around and not creating a new one each time
MethodProvider provider = new MethodProvider();
provider.combat.someMethod();
and it will know what you are talking about since Combat extends MethodProvider. Unfortunately, it doesn't quite work that way. Now, it
will work that way if Combat
didn't extend MethodProvider.
The reason is because there is no logistical reason for Combat
to be a MethodProvider, which is what happens when you extend MethodProvider. Keep in mind that if the code you have for MethodProvider did work, that the Combat class would contain a variable named actions (which would be an Actions object), a variable named handling (which would be a Handling object), a variable named dcombat (which would be a Combat object), and a variable named data (which would be a Data object) simply
because Combat extends MethodProvider. That is not what I think you are trying to do.
I can see how you could think what you did makes sense, but it is an example of one of those things that is great on paper but doesn't really translate to practice. Now, that doesn't mean that we can't get something similar to work, but it will take some feedback between you and me to get our brains synced up. I'm still trying to figure out what you think this can do and what you are trying to do. Once I have a better understanding of how this entire thing will be used, I will actually be able to get you to an answer.