Before 96 Posted August 14, 2016 I have a long series of if (getState() == state.STATE1) { return "STATE1"; } And it creates a tremendous amount of lag. I'm probably doing something wrong (and tbh it's not that important, it's just for a paint). Does anyone have an idea of what I could be doing wrong? Edit: I just did a super easy workaround idk why I was even doing this shit in the first place.
Before 96 Author Posted August 14, 2016 if (getState() == state.STATE1){ return "STATE1"; } Well I mean that's what I did
Volta 184 Posted August 14, 2016 Well I mean that's what I did if (getState() == state.STATE1) { return "STATE1"; }
Before 96 Author Posted August 14, 2016 Dude they're legit the same you put the sqiggly bracket on a line above it's identical
Diddy 265 Posted August 14, 2016 Paint can cause lag because it "loops" very fast, so it makes all calculations as fast as it can. (ofc i don't know the real technical explaination) anyways you should just do return getState().toString();
Eclipseop 194 Posted August 14, 2016 Paint can cause lag because it "loops" very fast, so it makes all calculations as fast as it can. (ofc i don't know the real technical explaination) anyways you should just do return getState().toString(); why even return the string? just return the enum type.
Diddy 265 Posted August 14, 2016 why even return the string? just return the enum type. because your paint doesn't paint enums
Dreamlicker 750 Posted August 14, 2016 For every if statement that you have of that nature, it is running your getState method once. So if you stored the state like private State (or whatever the enum is called) currentState; and then did currentState = getState(); then just check what currentState is.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.