Ejemplo n.º 1
0
    public void load(int type, int stage, boolean advanced) {
      this.type = type;
      this.stage = stage;
      this.advanced = advanced;
      this.minSteps = PuzzleInfo.minStep(type, stage, advanced);

      originalColorIndexes = new int[61];
      targetColorIndexes = new int[61];
      PuzzleInfo.readColorIndexes(type, stage, advanced, originalColorIndexes, targetColorIndexes);
    }
Ejemplo n.º 2
0
 @Override
 public void advance() {
   if (end) return;
   super.advance();
   switch (animDirection) {
     case ShowHint:
       if (hintAnimCount < HINT_ANIM_MAX) ++hintAnimCount;
       break;
     case HideHint:
       if (hintAnimCount > 0) --hintAnimCount;
       else {
         resetMask.setVisible(false);
         resetMask.setEnabled(false);
         animDirection = Stay;
       }
       break;
   }
   int[] currentColorIndexes = Ball.ballsToInts(balls);
   boolean finished = true;
   for (int i = 0; i < currentColorIndexes.length; ++i) {
     if (currentColorIndexes[i] != record.targetColorIndexes[i]) {
       finished = false;
       break;
     }
   }
   if (finished) {
     end = true;
     PuzzleInfo.testMinSteps(
         record.type, record.stage, record.advanced, currentMoveItem.getNumber());
     PuzzleNextStageWidget widget =
         new PuzzleNextStageWidget(record.type, record.stage, record.advanced);
     mainWidget.changeControl(widget, true);
   }
 }