X-Git-Url: http://dolda2000.com/gitweb/?p=kaka%2Fcakelight.git;a=blobdiff_plain;f=src%2Fkaka%2Fcakelight%2FCakeLight.java;h=cd59362c9c66044ca280d152b7fabd0dbacbb4bc;hp=822e2ab5d9c2975b2335f8808a3fa640e39a07a7;hb=c9edf58db4c00b7b95bb7f521063e5ecd79db262;hpb=d0afa6fb625ce2fe77d1ed6f0df8ed34391ddc35 diff --git a/src/kaka/cakelight/CakeLight.java b/src/kaka/cakelight/CakeLight.java index 822e2ab..cd59362 100644 --- a/src/kaka/cakelight/CakeLight.java +++ b/src/kaka/cakelight/CakeLight.java @@ -28,7 +28,7 @@ public class CakeLight { } public void cleanup() { - while (popMode()); + while (popMode() != null); } public void pushMode(Mode mode) { @@ -41,16 +41,16 @@ public class CakeLight { // TODO: create a composite fading mode of top of stack and new mode } - public boolean popMode() { + public Mode popMode() { if (!modes.isEmpty()) { Mode mode = modes.pop(); stopMode(mode); if (!modes.isEmpty()) { resumeMode(modes.peek()); } - return true; + return mode; } - return false; + return null; // TODO: create a composite fading mode of popped mode and top of stack, unless doing cleanup }