Project

General

Profile

« Previous | Next » 

Revision efa81f0c

Added by Leszek Koltunski over 2 years ago

Introduce abstract 4,6,8 adn 12 classes.

View differences:

src/main/java/org/distorted/objects/TwistyPyraminx.java
33 33

  
34 34
///////////////////////////////////////////////////////////////////////////////////////////////////
35 35

  
36
public class TwistyPyraminx extends TwistyObject
36
public class TwistyPyraminx extends Twisty4
37 37
{
38 38
  static final Static3D[] ROT_AXIS = new Static3D[]
39 39
         {
......
43 43
           new Static3D(-SQ6/3,+SQ3/3,     0),
44 44
         };
45 45

  
46
  private static final int[] FACE_COLORS = new int[]
47
         {
48
           COLOR_GREEN , COLOR_YELLOW,
49
           COLOR_BLUE  , COLOR_RED
50
         };
51

  
52 46
  private ScrambleState[] mStates;
53 47
  private int[] mBasicAngle;
54 48
  private Static4D[] mQuats;
......
202 196
    return mQuats;
203 197
    }
204 198

  
205
///////////////////////////////////////////////////////////////////////////////////////////////////
206

  
207
  int getNumFaceColors()
208
    {
209
    return FACE_COLORS.length;
210
    }
211

  
212 199
///////////////////////////////////////////////////////////////////////////////////////////////////
213 200

  
214 201
  int getSolvedFunctionIndex()
......
248 235
    return 8;
249 236
    }
250 237

  
251
///////////////////////////////////////////////////////////////////////////////////////////////////
252

  
253
  float getScreenRatio()
254
    {
255
    return 0.88f;
256
    }
257

  
258
///////////////////////////////////////////////////////////////////////////////////////////////////
259

  
260
  boolean shouldResetTextureMaps()
261
    {
262
    return false;
263
    }
264

  
265 238
///////////////////////////////////////////////////////////////////////////////////////////////////
266 239

  
267 240
  private int getNumOctahedrons(int numLayers)
......
355 328
    return cubit<getNumOctahedrons(numLayers) ? 0:1;
356 329
    }
357 330

  
358
///////////////////////////////////////////////////////////////////////////////////////////////////
359

  
360
  int getColor(int face)
361
    {
362
    return FACE_COLORS[face];
363
    }
364

  
365 331
///////////////////////////////////////////////////////////////////////////////////////////////////
366 332

  
367 333
  ObjectSticker retSticker(int face)
......
379 345
    return mStickers[face/NUM_FACE_COLORS];
380 346
    }
381 347

  
382
///////////////////////////////////////////////////////////////////////////////////////////////////
383
// SQ6/3 = height of the tetrahedron
384

  
385
  float returnMultiplier()
386
    {
387
    return getNumLayers()/(SQ6/3);
388
    }
389

  
390 348
///////////////////////////////////////////////////////////////////////////////////////////////////
391 349
// public API
392 350

  

Also available in: Unified diff