allockse
-
Posts
9 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by allockse
-
Your signature is awesome. I'd say most rocket designs would be golden just following this simple logic. That being said, your use of boolean is redundant. No need to check if a boolean is true like this: if(moves== true)...
Moves is true or false at runtime, so it can be evaluated on it's own:
if(moves)... or if(!moves)...
Your statement could be rewritten like this:
//does it move?
if (moves) {
if (supposedToMove) System.out.println("No Problem");
else System.out.println("Use Struts");
} else {
if(supposedToMove) System.out.println("No Problem");
else System.out.println("Use Boosters");
}
You could go even more extreme with some ternary syntax, but this way it's still readable for the lay folk.
/$.02
- Allockse