August 25, 20169 yr I don't know how to connect the Script variables or anything related to the Controller class for the JavaFX application, any ideas? Edited August 25, 20169 yr by Orient
August 25, 20169 yr Author Pass the script instance into the class? JavaFX applications need a no-args constructor and the controller class doesn't take the argument and act as a controller for some reason
August 25, 20169 yr JavaFX applications need a no-args constructor and the controller class doesn't take the argument and act as a controller for some reason I see, I've never touched JavaFX so I'm not exactly sure how to do this the best way. Have you seen this? http://stackoverflow.com/questions/30814258/javafx-pass-parameters-while-instantiating-controller-class Alternatively, if you don't really care about the code design you could just have a static getter in your main class, or in some sort of data class.
August 25, 20169 yr // don't forget the manifest public class Unicorns extends Script { public static Script script; @ Override public void onStart() { script = this; } @ Override public int onLoop() { return 69; } } This wonderful piece of code solves all your OOP problems Edited August 25, 20169 yr by Token
August 25, 20169 yr Author I see, I've never touched JavaFX so I'm not exactly sure how to do this the best way. Have you seen this? http://stackoverflow.com/questions/30814258/javafx-pass-parameters-while-instantiating-controller-class Alternatively, if you don't really care about the code design you could just have a static getter in your main class, or in some sort of data class. Alright, well I can't pass arguments to the Controller/Test classes properly so I'll have to do that. How can I go about doing that because it won't let me reference Script from a static context // don't forget the manifest public class Unicorns extends Script { public static Script script; @ Override public void onStart() { script = this; } @ Override public int onLoop() { return 69; } } This wonderful piece of code solves all your OOP problems I think I'm retarded Edited August 25, 20169 yr by Orient
August 25, 20169 yr // don't forget the manifest public class Unicorns extends Script { public static Script script; @ Override public void onStart() { script = this; } @ Override public int onLoop() { return 69; } } This wonderful piece of code solves all your OOP problems Feel like starting a debate so Ill go ahead and say that I wouldn't call it wonderful, bad code design and lack of encapsulation. Your turn.
August 25, 20169 yr Author Feel like starting a debate so Ill go ahead and say that I wouldn't call it wonderful, bad code design and lack of encapsulation. Your turn. Well, there's really no alternative in this case unless you can somehow pass a constructor to an application class to retrieve the Script methods.
August 25, 20169 yr Well, there's really no alternative in this case unless you can somehow pass a constructor to an application class to retrieve the Script methods. As a further note, I don't think you should be accessing Script methods in your JavaFX, instead of creating a Script instance, create a Unicorns instance (as demonstrated in @@Token's demonstration) and use that to pass the needed data into main. Just a thought, don't have to do it but I think its better practice
August 25, 20169 yr Feel like starting a debate so Ill go ahead and say that I wouldn't call it wonderful, bad code design and lack of encapsulation. Your turn. It decreases the stack frame size on all methods that require access to your Script instance by 64 bits Your turn.
August 25, 20169 yr Author As a further note, I don't think you should be accessing Script methods in your JavaFX, instead of creating a Script instance, create a Unicorns instance (as demonstrated in @@Token's demonstration) and use that to pass the needed data into main. Just a thought, don't have to do it but I think its better practice Well, I'm just grabbing things like name among other things, I just needed to gain access to those Nope, still retarded. Just going to pull the data from a separate class like a good little boy. Don't know what I'm talking about. Edited August 25, 20169 yr by Orient
August 25, 20169 yr It decreases the stack frame size on all methods that require access to your Script instance by 64 bits Your turn. Who cares this is runescape your turn I used all my cards in my first reply, i concede defeat Edited August 25, 20169 yr by Tom
August 25, 20169 yr Edited my post 3 times while you were creating this reply, your turn I was desperately browsing stackoverflow for an answer to "this is runescape" so as not to look overwhelmed by your argument while you were editting your reply your turn
Create an account or sign in to comment