Skip to content

Instantly share code, notes, and snippets.

@crazylion
Created February 10, 2014 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazylion/8912728 to your computer and use it in GitHub Desktop.
Save crazylion/8912728 to your computer and use it in GitHub Desktop.
void draw() {
if (currentStage==null) {
currentStage = (Stage) q.poll();
println("use Stage="+currentStage.name);
}
if (currentStage==null) {
}
else {
if (currentStage.status == StateType.INITIAL) {
callMethod(currentStage.initMethod);
}
else if (currentStage.status == StateType.FINAL) {
currentStage.status = StateType.INITIAL;
q.offer(currentStage);
currentStage=null;
}
else {
if (currentStage.checkMethod!=null) {
callMethod(currentStage.checkMethod);
}
if (currentStage.loopMethod!=null) {
callMethod(currentStage.loopMethod);
}
}
}
}
@tboydar
Copy link

tboydar commented Feb 10, 2014

int a = 0;
a = (currentStage==null) ? 1: 0;
switch(a)
{
case 1:
currentStage = (Stage) q.poll();
println("use Stage="+currentStage.name);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment