Project

General

Profile

« Previous | Next » 

Revision 20898e6f

Added by Leszek Koltunski over 2 years ago

Convert both Dinos to the new, unified scrambling method.

View differences:

src/main/java/org/distorted/objects/TwistyDino4.java
21 21

  
22 22
import android.content.res.Resources;
23 23

  
24
import org.distorted.helpers.ScrambleStateGraph;
24 25
import org.distorted.library.main.DistortedEffects;
25 26
import org.distorted.library.main.DistortedTexture;
26 27
import org.distorted.library.mesh.MeshSquare;
......
41 42
              DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
42 43
    {
43 44
    super(size, quat, texture, mesh, effects, moves, ObjectList.DIN4, res, scrWidth);
45

  
46
    mStates = new ScrambleStateGraph[]
47
      {
48
      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{0,1,5,0,-1,5              },{              2,1,8,2,-1,8} } ),
49
      new ScrambleStateGraph( new int[][] { {                          },{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
50
      new ScrambleStateGraph( new int[][] { {                          },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
51
      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{                          },{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
52
      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{                          },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
53
      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{                          },{0,1,7,0,-1,7              } } ),
54
      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{                          },{              2,1,8,2,-1,8} } ),
55
      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{                          } } ),
56
      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{                          } } ),
57
      };
44 58
    }
45 59

  
46 60
///////////////////////////////////////////////////////////////////////////////////////////////////
......
71 85
    return true;
72 86
    }
73 87

  
74
///////////////////////////////////////////////////////////////////////////////////////////////////
75

  
76
  public void randomizeNewScramble(int[][] scramble, Random rnd, int curr, int total)
77
    {
78
    if( curr==0 )
79
      {
80
      scramble[curr][0] = rnd.nextInt(NUM_AXIS);
81
      scramble[curr][1] = (scramble[curr][0]==1 || scramble[curr][0]==2) ? 0:2;
82
      }
83
    else
84
      {
85
      int newVector = rnd.nextInt(NUM_AXIS-1);
86
      scramble[curr][0] = (newVector>=scramble[curr-1][0] ? newVector+1 : newVector);
87
      scramble[curr][1] = scramble[curr-1][0]+scramble[curr][0]==3 ? 2-scramble[curr-1][1] : scramble[curr-1][1];
88
      }
89

  
90
    switch( rnd.nextInt(2) )
91
      {
92
      case 0: scramble[curr][2] = -1; break;
93
      case 1: scramble[curr][2] =  1; break;
94
      }
95
    }
96

  
97 88
///////////////////////////////////////////////////////////////////////////////////////////////////
98 89

  
99 90
  public int getObjectName(int numLayers)

Also available in: Unified diff