Project

General

Profile

« Previous | Next » 

Revision 61aa85e4

Added by Leszek Koltunski over 2 years ago

Simplify ObjectList: now there's just one object per size.

View differences:

src/main/java/org/distorted/objectlib/main/TwistyObject.java
102 102
  private final Static3D mNodeScale;
103 103
  private final Static4D mQuat;
104 104
  private final int mNumLayers, mRealSize;
105
  private final ObjectList mList;
106 105
  private final DistortedEffects mEffects;
107 106
  private final VertexEffectRotate mRotateEffect;
108 107
  private final Dynamic1D mRotationAngle;
......
134 133
///////////////////////////////////////////////////////////////////////////////////////////////////
135 134

  
136 135
  TwistyObject(int numLayers, int realSize, Static4D quat, DistortedTexture nodeTexture, MeshSquare nodeMesh,
137
               DistortedEffects nodeEffects, int[][] moves, ObjectList list, Resources res, int screenWidth)
136
               DistortedEffects nodeEffects, int[][] moves, Resources res, int screenWidth)
138 137
    {
139 138
    super(nodeTexture,nodeEffects,nodeMesh);
140 139

  
......
144 143

  
145 144
    mNumLayers = numLayers;
146 145
    mRealSize = realSize;
147
    mList = list;
148 146
    mOrigPos = getCubitPositions(mNumLayers);
149 147
    mAxis = getRotationAxis();
150 148
    mInitScreenRatio = getScreenRatio();
......
211 209
    if( mNumTexCols*mNumTexRows < NUM_TEXTURES+1 ) mNumTexRows++;
212 210

  
213 211
    CUBITS = new Cubit[NUM_CUBITS];
214
    createMeshAndCubits(list,res);
212
    createMeshAndCubits(res);
215 213
    createDataStructuresForSolved(numLayers);
216 214

  
217 215
    mTexture = new DistortedTexture();
......
268 266

  
269 267
///////////////////////////////////////////////////////////////////////////////////////////////////
270 268

  
271
  private void createMeshAndCubits(ObjectList list, Resources res)
269
  private void createMeshAndCubits(Resources res)
272 270
    {
273 271
    int resourceID= getResource(mNumLayers);
274 272

  
......
999 997
      quats.append(" ");
1000 998
      }
1001 999

  
1000
    String name = intGetObjectList(mNumLayers).name();
1001

  
1002 1002
    if( BuildConfig.DEBUG )
1003 1003
      {
1004 1004
      android.util.Log.e("quats" , quats.toString());
1005
      android.util.Log.e("object", mList.name()+"_"+mNumLayers);
1005
      android.util.Log.e("object", name);
1006 1006
      }
1007 1007
    else
1008 1008
      {
1009 1009
      Exception ex = new Exception(message);
1010 1010
      FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
1011 1011
      crashlytics.setCustomKey("quats" , quats.toString());
1012
      crashlytics.setCustomKey("object", mList.name()+"_"+mNumLayers );
1012
      crashlytics.setCustomKey("object", name);
1013 1013
      crashlytics.recordException(ex);
1014 1014
      }
1015 1015
    }
......
1272 1272

  
1273 1273
  public ObjectList getObjectList()
1274 1274
    {
1275
    return mList;
1275
    return intGetObjectList(mNumLayers);
1276 1276
    }
1277 1277

  
1278 1278
///////////////////////////////////////////////////////////////////////////////////////////////////
......
1304 1304
  protected abstract ObjectSticker retSticker(int face);
1305 1305
  protected abstract int getFaceColor(int cubit, int cubitface, int numLayers);
1306 1306
  protected abstract int getResource(int mNumLayers);
1307
  protected abstract ObjectList intGetObjectList(int numLayers);
1307 1308

  
1308 1309
  public abstract Movement getMovement();
1309 1310
  public abstract Static3D[] getRotationAxis();

Also available in: Unified diff