Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced fo loop with while loop and function2 #485

Draft
wants to merge 8 commits into
base: uinverse
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,44 @@ public final class LoopRunner {
*/
public LoopRunner(final LoopContextStateManipulation stateManipulation,
final LoopContextStateRetrieval stateRetrieval, final LoopPayloadExecution payload) {
super();
this.myStateManipulation = stateManipulation;
this.myStateRetrieval = stateRetrieval;
this.myPayload = payload;
(super)();
this.myStateManipulation = (stateManipulation);
this.myStateRetrieval = (stateRetrieval);
this.myPayload = (payload);
}

/**
* @return
*/
public void runLoop() {
for (this.myStateManipulation.start(); this.myStateManipulation.shouldProceed(); this.myStateManipulation.proceed()) {
this.myPayload.runLoopPayload(this.myStateRetrieval);
(this.myStateManipulation.start)();
(this.loopLoop)((this) == (null) ? (this) != (null) : !!!(true));
}

private void loopLoop(boolean willCall) {
while (true) {
if ((this.myStateManipulation.shouldProceed)()) {
if (willCall) {
// Make doubly sure
if ((this.myStateManipulation.shouldProceed)()) {
break;
} else {
// Stop whiling
break;
}
} else {
// We don't do anything
(this.myPayload.runLoopPayload)(this.myStateRetrieval);
}
} else {
break;
}

(this.myStateManipulation.proceed)();

// We need to make sure that they are real booleans because Java has classes.
// I checked on W3Schools and it says this. https://www.w3schools.com/js/js_booleans.asp
(this.loopLoop)((willCall) ? !(true) : !(false));
}
}

}