Project

General

Profile

« Previous | Next » 

Revision de697069

Added by Leszek Koltunski about 1 year ago

separate ObjectSiguature into its own package and separate the BandagedSignatures out of it.

View differences:

src/main/java/org/distorted/objects/RubikObjectList.java
18 18
import org.distorted.external.RubikFiles;
19 19
import org.distorted.external.RubikScores;
20 20
import org.distorted.main.RubikActivity;
21
import org.distorted.objectlib.main.ObjectSignatures;
21
import org.distorted.objectlib.signature.ObjectConstants;
22 22
import org.distorted.objectlib.main.ObjectType;
23 23

  
24 24
import static org.distorted.main.RubikActivity.SHOW_IAP_DEBUG;
......
32 32

  
33 33
public class RubikObjectList
34 34
{
35
  public static final int DEF_OBJECT= ObjectSignatures.CUBE_3;
35
  public static final int DEF_OBJECT= ObjectConstants.CUBE_3;
36 36
  private static RubikObjectList mThis;
37 37
  private static int mNumObjects;
38 38
  private static int mNumExtras;
src/main/java/org/distorted/screens/RubikScreenSolver.java
26 26
import android.widget.LinearLayout;
27 27

  
28 28
import org.distorted.objectlib.main.ObjectControl;
29
import org.distorted.objectlib.main.ObjectSignatures;
29
import org.distorted.objectlib.signature.ObjectConstants;
30 30
import org.distorted.objectlib.main.TwistyObject;
31 31

  
32 32
import org.distorted.dialogs.RubikDialogSolverError;
......
144 144
    {
145 145
    mColorMode = MODE_NORMAL;
146 146

  
147
    if( object== ObjectSignatures.PYRA_3 ||
148
        object== ObjectSignatures.PYRA_4 ||
149
        object== ObjectSignatures.PYRA_5 ||
150
        object== ObjectSignatures.PDUO_2 ||
151
        object== ObjectSignatures.JING_2 ||
152
        object== ObjectSignatures.MORP_2 ||
153
        object== ObjectSignatures.MORP_3 ||
154
        object== ObjectSignatures.MORP_4  )
147
    if( object== ObjectConstants.PYRA_3 ||
148
        object== ObjectConstants.PYRA_4 ||
149
        object== ObjectConstants.PYRA_5 ||
150
        object== ObjectConstants.PDUO_2 ||
151
        object== ObjectConstants.JING_2 ||
152
        object== ObjectConstants.MORP_2 ||
153
        object== ObjectConstants.MORP_3 ||
154
        object== ObjectConstants.MORP_4  )
155 155
      {
156 156
      mNumColors  = ShapeTetrahedron.NUM_FACES;
157 157
      mFaceColors = ShapeTetrahedron.FACE_COLORS;
158 158
      }
159
    else if( object== ObjectSignatures.DIAM_2 ||
160
             object== ObjectSignatures.DIAM_3 ||
161
             object== ObjectSignatures.DIAM_4 ||
162
             object== ObjectSignatures.TRAJ_3 ||
163
             object== ObjectSignatures.TRAJ_4 ||
164
             object== ObjectSignatures.PDIA_3  )
159
    else if( object== ObjectConstants.DIAM_2 ||
160
             object== ObjectConstants.DIAM_3 ||
161
             object== ObjectConstants.DIAM_4 ||
162
             object== ObjectConstants.TRAJ_3 ||
163
             object== ObjectConstants.TRAJ_4 ||
164
             object== ObjectConstants.PDIA_3  )
165 165
      {
166 166
      mNumColors  = ShapeOctahedron.NUM_FACES;
167 167
      mFaceColors = ShapeOctahedron.FACE_COLORS;
168 168
      }
169
    else if( object== ObjectSignatures.CRYS_3 ||
170
             object== ObjectSignatures.STAR_3 ||
171
             object== ObjectSignatures.PENT_2 ||
172
             object== ObjectSignatures.KILO_3 ||
173
             object== ObjectSignatures.KILO_5 ||
174
             object== ObjectSignatures.MEGA_3 ||
175
             object== ObjectSignatures.MEGA_5  )
169
    else if( object== ObjectConstants.CRYS_3 ||
170
             object== ObjectConstants.STAR_3 ||
171
             object== ObjectConstants.PENT_2 ||
172
             object== ObjectConstants.KILO_3 ||
173
             object== ObjectConstants.KILO_5 ||
174
             object== ObjectConstants.MEGA_3 ||
175
             object== ObjectConstants.MEGA_5  )
176 176
      {
177 177
      mNumColors  = ShapeDodecahedron.NUM_FACES;
178 178
      mFaceColors = ShapeDodecahedron.FACE_COLORS;
179 179
      }
180
    else if( object== ObjectSignatures.BALL_4 )
180
    else if( object== ObjectConstants.BALL_4 )
181 181
      {
182 182
      mNumColors  = ShapeDiamond.NUM_FACES;
183 183
      mFaceColors = ShapeDiamond.FACE_COLORS;
184 184
      }
185
    else if( object== ObjectSignatures.ICOS_2 )
185
    else if( object== ObjectConstants.ICOS_2 )
186 186
      {
187 187
      mNumColors  = ShapeIcosahedron.NUM_FACES;
188 188
      mFaceColors = ShapeIcosahedron.FACE_COLORS;
189 189
      }
190
    else if( object== ObjectSignatures.DIN4_3 )
190
    else if( object== ObjectConstants.DIN4_3 )
191 191
      {
192 192
      mNumColors  = 4;
193 193
      mFaceColors = new int[] { COLOR_YELLOW, COLOR_RED, COLOR_BLUE, COLOR_WHITE };
src/main/java/org/distorted/solvers/ImplementedSolversList.java
10 10
package org.distorted.solvers;
11 11

  
12 12
import org.distorted.main.R;
13
import org.distorted.objectlib.main.ObjectSignatures;
13
import org.distorted.objectlib.signature.ObjectConstants;
14 14

  
15 15
///////////////////////////////////////////////////////////////////////////////////////////////////
16 16

  
17 17
public enum ImplementedSolversList
18 18
{
19
  CUBE2          (ObjectSignatures.CUBE_2, R.string.solver_cube2_title, R.string.solver_cube2_description, true),
20
  CUBE3_KOCIEMBA (ObjectSignatures.CUBE_3, R.string.solver_cube3_title, R.string.solver_cube3_description, true),
21
  CU_232         (ObjectSignatures.CU_232, R.string.solver_cu232_title, R.string.solver_cu232_description, true),
22
  CU_323         (ObjectSignatures.CU_323, R.string.solver_cu323_title, R.string.solver_cu323_description, true),
23
  PYRAMINX       (ObjectSignatures.PYRA_3, R.string.solver_pyra3_title, R.string.solver_pyra3_description, true),
24
  SKEWB          (ObjectSignatures.SKEW_2, R.string.solver_skew2_title, R.string.solver_skew2_description, true),
25
  PYRAMINX_DUO   (ObjectSignatures.PDUO_2, R.string.solver_pduo2_title, R.string.solver_pduo2_description, true),
26
  IVY            (ObjectSignatures.IVY_2 , R.string.solver_ivy_title, R.string.solver_ivy_description, true),
27
  DIAMOND        (ObjectSignatures.DIAM_2, R.string.solver_diam2_title, R.string.solver_diam2_description, true),
28
  JING2          (ObjectSignatures.JING_2, R.string.solver_jing2_title, R.string.solver_jing2_description, true),
29
  DINO6          (ObjectSignatures.DINO_3, R.string.solver_dino6_title, R.string.solver_dino6_description, true),
30
  DINO4          (ObjectSignatures.DIN4_3, R.string.solver_dino4_title, R.string.solver_dino4_description, true),
31
  PDIA           (ObjectSignatures.PDIA_3, R.string.solver_pdia_title, R.string.solver_pdia_description, true),
19
  CUBE2          (ObjectConstants.CUBE_2, R.string.solver_cube2_title, R.string.solver_cube2_description, true),
20
  CUBE3_KOCIEMBA (ObjectConstants.CUBE_3, R.string.solver_cube3_title, R.string.solver_cube3_description, true),
21
  CU_232         (ObjectConstants.CU_232, R.string.solver_cu232_title, R.string.solver_cu232_description, true),
22
  CU_323         (ObjectConstants.CU_323, R.string.solver_cu323_title, R.string.solver_cu323_description, true),
23
  PYRAMINX       (ObjectConstants.PYRA_3, R.string.solver_pyra3_title, R.string.solver_pyra3_description, true),
24
  SKEWB          (ObjectConstants.SKEW_2, R.string.solver_skew2_title, R.string.solver_skew2_description, true),
25
  PYRAMINX_DUO   (ObjectConstants.PDUO_2, R.string.solver_pduo2_title, R.string.solver_pduo2_description, true),
26
  IVY            (ObjectConstants.IVY_2 , R.string.solver_ivy_title, R.string.solver_ivy_description, true),
27
  DIAMOND        (ObjectConstants.DIAM_2, R.string.solver_diam2_title, R.string.solver_diam2_description, true),
28
  JING2          (ObjectConstants.JING_2, R.string.solver_jing2_title, R.string.solver_jing2_description, true),
29
  DINO6          (ObjectConstants.DINO_3, R.string.solver_dino6_title, R.string.solver_dino6_description, true),
30
  DINO4          (ObjectConstants.DIN4_3, R.string.solver_dino4_title, R.string.solver_dino4_description, true),
31
  PDIA           (ObjectConstants.PDIA_3, R.string.solver_pdia_title, R.string.solver_pdia_description, true),
32 32
  ;
33 33

  
34 34
  public static final int NUM_OBJECTS = values().length;
src/main/java/org/distorted/solvers/SolverMain.java
12 12
import android.content.res.Resources;
13 13

  
14 14
import org.distorted.objectlib.helpers.OperatingSystemInterface;
15
import org.distorted.objectlib.main.ObjectSignatures;
15
import org.distorted.objectlib.signature.ObjectConstants;
16 16
import org.distorted.objectlib.main.TwistyObject;
17 17

  
18 18
import org.distorted.main.R;
......
47 47

  
48 48
  public static int cubitIsLocked(int object, int cubit)
49 49
    {
50
    if( object == ObjectSignatures.CUBE_3 )
50
    if( object == ObjectConstants.CUBE_3 )
51 51
      {
52 52
      if( cubit==20 ) return 0; // center of the right  face
53 53
      if( cubit==21 ) return 1; // center of the left   face
......
74 74
    {
75 75
    RubikScreenSolver screen = (RubikScreenSolver) ScreenList.SVER.getScreenClass();
76 76

  
77
    if( mSignature==ObjectSignatures.CUBE_3 )
77
    if( mSignature==ObjectConstants.CUBE_3 )
78 78
      {
79 79
      SolverCube3 solver = new SolverCube3(mOS,mRes,mObject);
80 80
      solver.solve(screen);
81 81
      }
82
    else if( mSignature==ObjectSignatures.PDUO_2 )
82
    else if( mSignature==ObjectConstants.PDUO_2 )
83 83
      {
84 84
      SolverTablebase solver = new SolverPyraminxDuo(mOS,mRes,mObject);
85 85
      solver.solve(screen);
86 86
      }
87
    else if( mSignature==ObjectSignatures.IVY_2 )
87
    else if( mSignature==ObjectConstants.IVY_2 )
88 88
      {
89 89
      SolverTablebase solver = new SolverIvyCube(mOS,mRes,mObject);
90 90
      solver.solve(screen);
91 91
      }
92
    else if( mSignature==ObjectSignatures.CU_232 )
92
    else if( mSignature==ObjectConstants.CU_232 )
93 93
      {
94 94
      SolverTablebase solver = new SolverCuboid232(mOS,mRes,mObject);
95 95
      solver.solve(screen);
96 96
      }
97
    else if( mSignature==ObjectSignatures.CU_323 )
97
    else if( mSignature==ObjectConstants.CU_323 )
98 98
      {
99 99
      SolverTablebase solver = new SolverCuboid323(mOS,mRes,mObject);
100 100
      solver.solve(screen);
101 101
      }
102
    else if( mSignature==ObjectSignatures.PYRA_3 )
102
    else if( mSignature==ObjectConstants.PYRA_3 )
103 103
      {
104 104
      SolverTablebase solver = new SolverPyraminx(mOS,mRes,mObject);
105 105
      solver.solve(screen);
106 106
      }
107
    else if( mSignature==ObjectSignatures.DIAM_2 )
107
    else if( mSignature==ObjectConstants.DIAM_2 )
108 108
      {
109 109
      SolverTablebase solver = new SolverSkewbDiamond(mOS,mRes,mObject);
110 110
      solver.solve(screen);
111 111
      }
112
    else if( mSignature==ObjectSignatures.CUBE_2 )
112
    else if( mSignature==ObjectConstants.CUBE_2 )
113 113
      {
114 114
      SolverTablebase solver = new SolverCube2(mOS,mRes,mObject);
115 115
      solver.solve(screen);
116 116
      }
117
    else if( mSignature==ObjectSignatures.JING_2 )
117
    else if( mSignature==ObjectConstants.JING_2 )
118 118
      {
119 119
      SolverTablebase solver = new SolverJing(mOS,mRes,mObject);
120 120
      solver.solve(screen);
121 121
      }
122
    else if( mSignature==ObjectSignatures.SKEW_2 )
122
    else if( mSignature==ObjectConstants.SKEW_2 )
123 123
      {
124 124
      SolverTablebase solver = new SolverSkewb(mOS,mRes,mObject);
125 125
      solver.solve(screen);
126 126
      }
127
    else if( mSignature==ObjectSignatures.DINO_3 )
127
    else if( mSignature==ObjectConstants.DINO_3 )
128 128
      {
129 129
      SolverTablebase solver = new SolverDino6(mOS,mRes,mObject);
130 130
      solver.solve(screen);
131 131
      }
132
    else if( mSignature==ObjectSignatures.DIN4_3 )
132
    else if( mSignature==ObjectConstants.DIN4_3 )
133 133
      {
134 134
      SolverTablebase solver = new SolverDino4(mOS,mRes,mObject);
135 135
      solver.solve(screen);
136 136
      }
137
    else if( mSignature==ObjectSignatures.PDIA_3 )
137
    else if( mSignature==ObjectConstants.PDIA_3 )
138 138
      {
139 139
      SolverTablebase solver = new SolverPyraminxDiamond(mOS,mRes,mObject);
140 140
      solver.solve(screen);

Also available in: Unified diff