Jump to content
Corncob

Matrix 3: Rotten Potato

Recommended Posts

Please login or register to see this code.

 

Share this post


Link to post
Share on other sites

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
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
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
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

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
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 :grin:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×