Corncob 1 #1 Posted October 1, 2016 Please login or register to see this code. Share this post Link to post Share on other sites
Hope 2 #2 Posted October 1, 2016 Please build a better refreshing system in your equipment class: Please login or register to see this code. Share this post Link to post Share on other sites
wot 0 #3 Posted October 1, 2016 3 hours ago, Hope said: Please build a better refreshing system in your equipment class: Please login or register to see this code. Please login or register to see this code. This is already in matrix bro, so you could just do refresh(IntStream.rangeClosed(0, 14).toArray()); Share this post Link to post Share on other sites
Hope 2 #4 Posted October 5, 2016 On 10/1/2016 at 11:32 AM, wot said: Please login or register to see this code. This is already in matrix bro, so you could just do refresh(IntStream.rangeClosed(0, 14).toArray()); I literally have no clue what is in matrix and what isn't. I typed that up as an example (pseudo-code ish if you will). Share this post Link to post Share on other sites
Bevypoo 0 #5 Posted October 15, 2016 holy fuck so bad Share this post Link to post Share on other sites
Gemu 28 #6 Posted October 15, 2016 3 hours ago, Bevypoo said: holy fuck so bad Instead of that, tell us in which way the user would be able to make improvements on this. Share this post Link to post Share on other sites
kaos 0 #7 Posted November 18, 2016 Perhaps separating them into methods and possibly using a switch might make it look a little cleaner, that is one hell of a block of code Share this post Link to post Share on other sites
Eldritch 0 #8 Posted November 18, 2016 33 minutes ago, kaos said: Perhaps separating them into methods and possibly using a switch might make it look a little cleaner, that is one hell of a block of code It's a dialogue. Dialogues generally tend to get messy and long (Not saying they have to, but most of them will). He could however shorten the code by at least three times, by doing: a) for (int i = 0; i < 14; i++) player.getEquipment().refresh(i); b) Making a container (For example an array, or a hashmap if you need to list down more than one attribute) for the items, so instead of writing each and every single one of them out you could also loop them the same way c) Using switches - This isn't an issue really, however it'd slightly shorten and clean the code up a bit more. If all these three would be optimized to the fullest, your code would be at least three times shorter lines length-wise. I know this is an ancient post, just figured I'd increase my post count Share this post Link to post Share on other sites