diff --git a/app/src/main/java/com/example/jnicpp/bowling/PosePhaseDetector.kt b/app/src/main/java/com/example/jnicpp/bowling/PosePhaseDetector.kt index 966914c..64d647d 100644 --- a/app/src/main/java/com/example/jnicpp/bowling/PosePhaseDetector.kt +++ b/app/src/main/java/com/example/jnicpp/bowling/PosePhaseDetector.kt @@ -197,14 +197,18 @@ class PosePhaseDetector { rightElbowAngleDegrees = angles.rightElbow ) - // Identify the next phase we are looking for in the sequence. + // Identify the next phase we are looking for in the sequence. The + // only BowlingPhase values not already matched above are + // BACK_SWING/POWER_STEP (never currentPhase -- see this class's + // doc) and FOLLOW_THROUGH, so reaching else always means + // FOLLOW_THROUGH: the final phase, nothing to advance to. val targetPhase = when (currentPhase) { null -> BowlingPhase.STARTING_STANCE BowlingPhase.STARTING_STANCE -> BowlingPhase.APPROACH BowlingPhase.APPROACH -> BowlingPhase.PUSHAWAY BowlingPhase.PUSHAWAY -> BowlingPhase.SLIDE_AND_RELEASE BowlingPhase.SLIDE_AND_RELEASE -> BowlingPhase.FOLLOW_THROUGH - else -> currentPhase + else -> BowlingPhase.FOLLOW_THROUGH } // 1. Check if the user is in the NEXT phase.