Gilgad Posted September 15, 2014 Posted September 15, 2014 (edited) So i've been working on an AIO magic, i've decided to use nodes, now with the abstract class, i've got a boolean execute and a boolean validate. With these two, the validation sends off to the main class whether the sub class that extends the abstract is true, if it is true, it will then execute the code from the execution in that sub class. My question is, for some odd reason, my states, or the switch states, return null, can you not have states outside of the boolean execution? Does it all have to be inside that exeuction? This is the only thing stopping my magic script I do a null pointer check and my get states = null so nothing happens, got no idea why. If you'd like to look at a sample of the code and think you have a solution, send me a pm PS: Cheers to booch for your tutorial man, was great! Edited September 15, 2014 by Gilgad
Swizzbeat Posted September 15, 2014 Posted September 15, 2014 ^ Also change the name "node" to something like task considering the whole idea makes no sense. 1
Dreamliner Posted September 15, 2014 Posted September 15, 2014 As long as you have a container for your nodes, which is looped though, you should have no problem with NPE's. Your node class makes you able to keep all of your tasks in one list. Makes is easier to manage. So as long as you have a getState in your node class, you should be fine 1
Gilgad Posted September 15, 2014 Author Posted September 15, 2014 Cheers to Frostbug and nezz, sorted the issue