Project

General

Profile

« Previous | Next » 

Revision 7ee89540

Added by Leszek Koltunski about 3 years ago

Remove redundant variable.

View differences:

src/main/java/org/distorted/objects/Movement.java
50 50
  private float[][] mTouchBorders, mA, mB;
51 51

  
52 52
  private final int mType;
53
  private final int[] mNumEnabled;
54 53
  private final int[][][] mEnabled;
55 54

  
56 55
///////////////////////////////////////////////////////////////////////////////////////////////////
......
62 61
///////////////////////////////////////////////////////////////////////////////////////////////////
63 62

  
64 63
  Movement(Static3D[] rotAxis, Static3D[] faceAxis, float[][] cuts, boolean[][] rotatable,
65
           float distance3D, int size, int type, int[] numEnabled, int[][][] enabled)
64
           float distance3D, int size, int type, int[][][] enabled)
66 65
    {
67 66
    mPoint = new float[3];
68 67
    mCamera= new float[3];
......
72 71
    mMove2D  = new float[2];
73 72

  
74 73
    mType = type;
75
    mNumEnabled = numEnabled;
76 74
    mEnabled = enabled;
77 75

  
78 76
    mFaceAxis   = faceAxis;
......
402 400
    {
403 401
    int part = returnPart(mType,face,touchPoint);
404 402

  
405
    int num = mNumEnabled[face];
403
    int num = mEnabled[face][0].length;
406 404
    enabled[0] = num;
407 405
    System.arraycopy(mEnabled[face][part], 0, enabled, 1, num);
408 406
    }
src/main/java/org/distorted/objects/Movement12.java
53 53

  
54 54
///////////////////////////////////////////////////////////////////////////////////////////////////
55 55

  
56
  Movement12(Static3D[] rotAxis,float[][] cuts, boolean[][] rotatable, int size, int type, int[] numEnabled, int[][][] enabled)
56
  Movement12(Static3D[] rotAxis,float[][] cuts, boolean[][] rotatable, int size, int type, int[][][] enabled)
57 57
    {
58
    super(rotAxis, FACE_AXIS, cuts,rotatable,DIST3D, size, type, numEnabled, enabled);
58
    super(rotAxis, FACE_AXIS, cuts,rotatable,DIST3D, size, type, enabled);
59 59
    }
60 60

  
61 61
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objects/Movement4.java
39 39

  
40 40
///////////////////////////////////////////////////////////////////////////////////////////////////
41 41

  
42
  Movement4(Static3D[] rotAxis,float[][] cuts, boolean[][] rotatable, int size, int type, int[] numEnabled, int[][][] enabled)
42
  Movement4(Static3D[] rotAxis,float[][] cuts, boolean[][] rotatable, int size, int type, int[][][] enabled)
43 43
    {
44
    super(rotAxis, FACE_AXIS, cuts, rotatable, DIST3D, size, type, numEnabled, enabled);
44
    super(rotAxis, FACE_AXIS, cuts, rotatable, DIST3D, size, type, enabled);
45 45
    }
46 46

  
47 47
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objects/Movement6.java
38 38

  
39 39
///////////////////////////////////////////////////////////////////////////////////////////////////
40 40

  
41
  Movement6(Static3D[] rotAxis,float[][] cuts, boolean[][] rotatable, int size, int type, int[] numEnabled, int[][][] enabled)
41
  Movement6(Static3D[] rotAxis,float[][] cuts, boolean[][] rotatable, int size, int type, int[][][] enabled)
42 42
    {
43
    super(rotAxis, FACE_AXIS, cuts, rotatable, DIST3D, size, type, numEnabled, enabled);
43
    super(rotAxis, FACE_AXIS, cuts, rotatable, DIST3D, size, type, enabled);
44 44
    }
45 45

  
46 46
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objects/Movement8.java
39 39

  
40 40
///////////////////////////////////////////////////////////////////////////////////////////////////
41 41

  
42
  Movement8(Static3D[] rotAxis,float[][] cuts, boolean[][] rotatable, int size, int type, int[] numEnabled, int[][][] enabled)
42
  Movement8(Static3D[] rotAxis,float[][] cuts, boolean[][] rotatable, int size, int type, int[][][] enabled)
43 43
    {
44
    super(rotAxis, FACE_AXIS, cuts, rotatable, DIST3D, size, type, numEnabled, enabled);
44
    super(rotAxis, FACE_AXIS, cuts, rotatable, DIST3D, size, type, enabled);
45 45
    }
46 46

  
47 47
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objects/TwistyBandagedAbstract.java
53 53
         {2,2,2}
54 54
        };
55 55

  
56
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
57

  
58 56
  private static final int[][][] ENABLED = new int[][][]
59 57
      {
60 58
          {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}},
......
466 464
      int numLayers = getNumLayers();
467 465
      if( mCuts==null ) getCuts(numLayers);
468 466
      getLayerRotatable(numLayers);
469
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED);
467
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
470 468
      }
471 469
    return mMovement;
472 470
    }
src/main/java/org/distorted/objects/TwistyCube.java
44 44
           new Static3D(0,0,1)
45 45
         };
46 46

  
47
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
48

  
49 47
  private static final int[][][] ENABLED = new int[][][]
50 48
      {
51 49
          {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}},
......
363 361
      int numLayers = getNumLayers();
364 362
      if( mCuts==null ) getCuts(numLayers);
365 363
      getLayerRotatable(numLayers);
366
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED);
364
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
367 365
      }
368 366
    return mMovement;
369 367
    }
src/main/java/org/distorted/objects/TwistyDiamond.java
46 46
           new Static3D(     0,-SQ3/3,+SQ6/3)
47 47
         };
48 48

  
49
  private static final int[] NUM_ENABLED = {3,3,3,3,3,3,3,3};
50

  
51 49
  private static final int[][][] ENABLED = new int[][][]
52 50
      {
53 51
          {{1,2,3}},{{1,2,3}},{{0,2,3}},{{0,2,3}},{{0,1,3}},{{0,1,3}},{{0,1,2}},{{0,1,2}}
......
506 504
      int numLayers = getNumLayers();
507 505
      if( mCuts==null ) getCuts(numLayers);
508 506
      getLayerRotatable(numLayers);
509
      mMovement = new Movement8(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED);
507
      mMovement = new Movement8(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
510 508
      }
511 509
    return mMovement;
512 510
    }
src/main/java/org/distorted/objects/TwistyDino.java
45 45
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
46 46
         };
47 47

  
48
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
49

  
50 48
  private static final int[][][] ENABLED = new int[][][]
51 49
      {
52 50
          {{0,1},{3,1},{2,3},{0,2}},
......
240 238
      int numLayers = getNumLayers();
241 239
      if( mCuts==null ) getCuts(numLayers);
242 240
      getLayerRotatable(numLayers);
243
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,NUM_ENABLED,ENABLED);
241
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,ENABLED);
244 242
      }
245 243
    return mMovement;
246 244
    }
src/main/java/org/distorted/objects/TwistyHelicopter.java
48 48
           new Static3D(-SQ2/2, -SQ2/2,      0)
49 49
         };
50 50

  
51
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
52

  
53 51
  private static final int[][][] ENABLED = new int[][][]
54 52
      {
55 53
          {{2,5},{2,4},{3,4},{3,5}},
......
433 431
      int numLayers = getNumLayers();
434 432
      if( mCuts==null ) getCuts(numLayers);
435 433
      getLayerRotatable(numLayers);
436
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_EDGE,NUM_ENABLED,ENABLED);
434
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_EDGE,ENABLED);
437 435
      }
438 436
    return mMovement;
439 437
    }
src/main/java/org/distorted/objects/TwistyIvy.java
45 45
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
46 46
         };
47 47

  
48
  private static final int[] NUM_ENABLED = {1,1,1,1,1,1};
49

  
50 48
  private static final int[][][] ENABLED = new int[][][]
51 49
      {
52 50
          {{0},{3},{3},{0}},
......
460 458
      int numLayers = getNumLayers();
461 459
      if( mCuts==null ) getCuts(numLayers);
462 460
      getLayerRotatable(numLayers);
463
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,NUM_ENABLED,ENABLED);
461
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,ENABLED);
464 462
      }
465 463
    return mMovement;
466 464
    }
src/main/java/org/distorted/objects/TwistyJing.java
45 45
           new Static3D(-SQ6/3,+SQ3/3,     0),
46 46
         };
47 47

  
48
  private static final int[] NUM_ENABLED = {3,3,3,3};
49

  
50 48
  private static final int[][][] ENABLED = new int[][][]
51 49
      {
52 50
          {{1,2,3}},{{0,2,3}},{{0,1,3}},{{0,1,2}}
......
419 417
      int numLayers = getNumLayers();
420 418
      if( mCuts==null ) getCuts(numLayers);
421 419
      getLayerRotatable(numLayers);
422
      mMovement = new Movement4(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED);
420
      mMovement = new Movement4(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
423 421
      }
424 422
    return mMovement;
425 423
    }
src/main/java/org/distorted/objects/TwistyMinx.java
59 59
           new Static3D( SIN54/LEN,    0     ,   -C2/LEN )
60 60
         };
61 61

  
62
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2,2,2,2,2,2,2};
63

  
64 62
  private static final int[][][] ENABLED = new int[][][]
65 63
      {
66 64
          {{2,3},{3,5},{1,5},{1,4},{2,4}},
......
609 607
      int numLayers = getNumLayers();
610 608
      if( mCuts==null ) getCuts(numLayers);
611 609
      getLayerRotatable(numLayers);
612
      mMovement = new Movement12(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_EDGE,NUM_ENABLED,ENABLED);
610
      mMovement = new Movement12(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_EDGE,ENABLED);
613 611
      }
614 612
    return mMovement;
615 613
    }
src/main/java/org/distorted/objects/TwistyMirror.java
44 44
           new Static3D(0,0,1)
45 45
         };
46 46

  
47
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
48

  
49 47
  private static final int[][][] ENABLED = new int[][][]
50 48
      {
51 49
          {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}},
......
663 661
      int numLayers = getNumLayers();
664 662
      if( mCuts==null ) getCuts(numLayers);
665 663
      getLayerRotatable(numLayers);
666
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED);
664
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
667 665
      }
668 666
    return mMovement;
669 667
    }
src/main/java/org/distorted/objects/TwistyPyraminx.java
45 45
           new Static3D(-SQ6/3,+SQ3/3,     0),
46 46
         };
47 47

  
48
  private static final int[] NUM_ENABLED = {3,3,3,3};
49

  
50 48
  private static final int[][][] ENABLED = new int[][][]
51 49
      {
52 50
          {{1,2,3}},{{0,2,3}},{{0,1,3}},{{0,1,2}}
......
390 388
      int numLayers = getNumLayers();
391 389
      if( mCuts==null ) getCuts(numLayers);
392 390
      getLayerRotatable(numLayers);
393
      mMovement = new Movement4(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED);
391
      mMovement = new Movement4(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
394 392
      }
395 393
    return mMovement;
396 394
    }
src/main/java/org/distorted/objects/TwistyRedi.java
45 45
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
46 46
         };
47 47

  
48
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
49

  
50 48
  private static final int[][][] ENABLED = new int[][][]
51 49
      {
52 50
          {{0,1},{3,1},{2,3},{0,2}},
......
430 428
      int numLayers = getNumLayers();
431 429
      if( mCuts==null ) getCuts(numLayers);
432 430
      getLayerRotatable(numLayers);
433
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,NUM_ENABLED,ENABLED);
431
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,ENABLED);
434 432
      }
435 433
    return mMovement;
436 434
    }
src/main/java/org/distorted/objects/TwistyRex.java
45 45
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
46 46
         };
47 47

  
48
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
49

  
50 48
  private static final int[][][] ENABLED = new int[][][]
51 49
      {
52 50
          {{0,1},{3,1},{2,3},{0,2}},
......
463 461
      int numLayers = getNumLayers();
464 462
      if( mCuts==null ) getCuts(numLayers);
465 463
      getLayerRotatable(numLayers);
466
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,NUM_ENABLED,ENABLED);
464
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,ENABLED);
467 465
      }
468 466
    return mMovement;
469 467
    }
src/main/java/org/distorted/objects/TwistySkewb.java
45 45
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
46 46
         };
47 47

  
48
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2};
49

  
50 48
  private static final int[][][] ENABLED = new int[][][]
51 49
      {
52 50
          {{0,1},{3,1},{2,3},{0,2}},
......
566 564
      int numLayers = getNumLayers();
567 565
      if( mCuts==null ) getCuts(numLayers);
568 566
      getLayerRotatable(numLayers);
569
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,2*numLayers-2,TYPE_SPLIT_CORNER,NUM_ENABLED,ENABLED);
567
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,2*numLayers-2,TYPE_SPLIT_CORNER,ENABLED);
570 568
      }
571 569
    return mMovement;
572 570
    }
src/main/java/org/distorted/objects/TwistySquare.java
48 48
      new Static3D(0,-1,0),
49 49
    };
50 50

  
51
  private static final int[] NUM_ENABLED = {1,1,1,1,2,2};
52

  
53 51
  private static final int[][][] ENABLED = new int[][][]
54 52
    {
55 53
      {{0}},{{0}},{{1}},{{1}},{{0,1}},{{0,1}}
......
164 162
      int numLayers = getNumLayers();
165 163
      if( mCuts==null ) getCuts(numLayers);
166 164
      getLayerRotatable(numLayers);
167
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED);
165
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
168 166
      }
169 167
    return mMovement;
170 168
    }
src/main/java/org/distorted/objects/TwistyUltimate.java
53 53
           new Static3D( 0,C,-B)
54 54
         };
55 55

  
56
  private static final int[] NUM_ENABLED = {2,2,2,2,2,2,2,2,2,2,2,2};
57

  
58 56
  private static final int[][][] ENABLED = new int[][][]
59 57
    {
60 58
      {{2,3}},{{1,3}},{{1,3}},{{2,3}},{{0,3}},{{0,2}},{{0,2}},{{0,3}},{{1,2}},{{0,1}},{{0,1}},{{1,2}}
......
418 416
      int numLayers = getNumLayers();
419 417
      if( mCuts==null ) getCuts(numLayers);
420 418
      getLayerRotatable(numLayers);
421
      mMovement = new Movement12(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED);
419
      mMovement = new Movement12(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
422 420
      }
423 421
    return mMovement;
424 422
    }

Also available in: Unified diff