Project

General

Profile

« Previous | Next » 

Revision e4733ed7

Added by Leszek Koltunski about 2 years ago

New, generic bandaged 3x3 class 'TwistyBandagedAbstract'.

Now, (almost!) any bandaged 3x3 can be created by extending this class and implementing one abstract method 'getPositions()'. Almost, because there's still one restriction: currently all cubits need to be one of the 5 allowed types: 1x1x1, 2x1x1, 3x1x1, 2x2x1, 2x2x2.

Still, two missing 'TODOs' need to be implemented for truly 'any' bandaged cube to be supported.

View differences:

src/main/java/org/distorted/objects/RubikObjectList.java
24 24
import android.content.SharedPreferences;
25 25

  
26 26
import org.distorted.main.RubikActivity;
27
import org.distorted.objectlib.main.ObjectConstants;
27
import org.distorted.objectlib.main.ObjectSignatures;
28 28
import org.distorted.objectlib.main.ObjectType;
29 29
import org.distorted.screens.RubikScreenPlay;
30 30
import org.distorted.screens.ScreenList;
......
37 37

  
38 38
public class RubikObjectList
39 39
{
40
  public static final int DEF_OBJECT= ObjectConstants.CUBE_3;
40
  public static final int DEF_OBJECT= ObjectSignatures.CUBE_3;
41 41
  public static int MAX_LEVEL;
42 42

  
43 43
  private static RubikObjectList mThis;
......
164 164

  
165 165
  public static int getDBLevel(int ordinal)
166 166
    {
167
    if( ordinal==ObjectConstants.CUBE_3 ) return 16;
168
    if( ordinal==ObjectConstants.CUBE_4 ) return 20;
169
    if( ordinal==ObjectConstants.CUBE_5 ) return 24;
170
    if( ordinal==ObjectConstants.BAN2_3 ) return 16;
171
    if( ordinal==ObjectConstants.BAN4_3 ) return 16;
172
    if( ordinal==ObjectConstants.PYRA_4 ) return 15;
173
    if( ordinal==ObjectConstants.PYRA_5 ) return 20;
174
    if( ordinal==ObjectConstants.MEGA_5 ) return 35;
175
    if( ordinal==ObjectConstants.DIAM_2 ) return 10;
176
    if( ordinal==ObjectConstants.DIAM_3 ) return 18;
177
    if( ordinal==ObjectConstants.REDI_3 ) return 14;
178
    if( ordinal==ObjectConstants.HELI_3 ) return 18;
179
    if( ordinal==ObjectConstants.SKEW_3 ) return 17;
180
    if( ordinal==ObjectConstants.REX_3  ) return 16;
181
    if( ordinal==ObjectConstants.MIRR_3 ) return 16;
167
    if( ordinal== ObjectSignatures.CUBE_3 ) return 16;
168
    if( ordinal== ObjectSignatures.CUBE_4 ) return 20;
169
    if( ordinal== ObjectSignatures.CUBE_5 ) return 24;
170
    if( ordinal== ObjectSignatures.BAN2_3 ) return 16;
171
    if( ordinal== ObjectSignatures.BAN4_3 ) return 16;
172
    if( ordinal== ObjectSignatures.PYRA_4 ) return 15;
173
    if( ordinal== ObjectSignatures.PYRA_5 ) return 20;
174
    if( ordinal== ObjectSignatures.MEGA_5 ) return 35;
175
    if( ordinal== ObjectSignatures.DIAM_2 ) return 10;
176
    if( ordinal== ObjectSignatures.DIAM_3 ) return 18;
177
    if( ordinal== ObjectSignatures.REDI_3 ) return 14;
178
    if( ordinal== ObjectSignatures.HELI_3 ) return 18;
179
    if( ordinal== ObjectSignatures.SKEW_3 ) return 17;
180
    if( ordinal== ObjectSignatures.REX_3  ) return 16;
181
    if( ordinal== ObjectSignatures.MIRR_3 ) return 16;
182 182

  
183 183
    // in 1.9.6 & 1.9.7 there is a bug with downloadable objects (in this very function!):
184 184
    // All of those have DBLevel equal to CUBE_3's DBlevel (in 1.9.7!), i.e. 17.

Also available in: Unified diff