Project

General

Profile

« Previous | Next » 

Revision 8b3b1d85

Added by Leszek Koltunski over 2 years ago

Changes to the initialization - initialize the 'bought objects'

View differences:

src/main/java/org/distorted/objectlib/json/JsonReader.java
66 66
  private int[] mNumLayers;
67 67
  private float mSize;
68 68
  private int mScrambleType, mNumScrambles;
69
  private boolean mIsFree;
69
  private int mPrice;
70 70
  private int[] mColor;
71 71
  private int mInternalColor;
72 72
  private boolean mResetMaps;
......
107 107
    mNumScrambles    = object.getInt("scrambles");
108 108
    mResetMaps       = object.getBoolean("resetmaps");
109 109
    mNumFaces        = object.getInt("num_faces");
110
    mIsFree          = true;
110
    mPrice           = 0;
111 111

  
112 112
    try
113 113
      {
......
136 136
    mNumScrambles    = object.getInt("scrambles");
137 137
    mResetMaps       = object.getBoolean("resetmaps");
138 138
    mNumFaces        = object.getInt("num_faces");
139
    mIsFree          = true;
139
    mPrice           = 0;
140 140

  
141 141
    try
142 142
      {
......
193 193
      mSignature = new ObjectSignature(signature);
194 194
      }
195 195

  
196
    mIsFree = object.optBoolean("free", true);
196
    boolean free = object.optBoolean("free", true);
197

  
198
    if( free ) mPrice = 0;
199
    else mPrice = object.optInt("price", ObjectType.DEFAULT_PRICE_OF_OLD_OBJECTS );
197 200
    }
198 201

  
199 202
///////////////////////////////////////////////////////////////////////////////////////////////////
......
843 846

  
844 847
///////////////////////////////////////////////////////////////////////////////////////////////////
845 848

  
846
  public void readNumScramblesAndIsFree(Context context, String fileName) throws IOException, JSONException
849
  public void readNumScramblesAndPrice(Context context, String fileName) throws IOException, JSONException
847 850
    {
848 851
    File file = new File(context.getFilesDir(), fileName);
849 852
    InputStream stream = new FileInputStream(file);
......
858 861
    JSONObject object = new JSONObject(contents.toString());
859 862
    JSONObject metadata = object.getJSONObject("metadata");
860 863
    mNumScrambles = metadata.getInt("scrambles");
861
    mIsFree       = metadata.optBoolean("free",true);
864

  
865
    boolean free = metadata.optBoolean("free",true);
866
    if( free ) mPrice = 0;
867
    else mPrice = metadata.optInt("price", ObjectType.DEFAULT_PRICE_OF_OLD_OBJECTS );
862 868
    }
863 869

  
864 870
///////////////////////////////////////////////////////////////////////////////////////////////////
......
1057 1063

  
1058 1064
///////////////////////////////////////////////////////////////////////////////////////////////////
1059 1065

  
1060
  public boolean isFree()
1066
  public int getPrice()
1061 1067
    {
1062
    return mIsFree;
1068
    return mPrice;
1063 1069
    }
1064 1070

  
1065 1071
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objectlib/json/JsonWriter.java
386 386

  
387 387
///////////////////////////////////////////////////////////////////////////////////////////////////
388 388

  
389
  private JSONObject generateMetadata(TwistyObject object, int numScramble, boolean isFree) throws JSONException
389
  private JSONObject generateMetadata(TwistyObject object, int numScramble, int price) throws JSONException
390 390
    {
391 391
    JSONObject metadata = new JSONObject();
392 392

  
......
399 399
    metadata.put("shortname"  , object.getShortName() );
400 400
    metadata.put("resetmaps"  , object.shouldResetTextureMaps() );
401 401
    metadata.put("num_faces"  , object.getNumFaces() );
402
    metadata.put("free"       , isFree );
402
    metadata.put("price"      , price );
403 403

  
404 404
    JSONArray sigArray = new JSONArray();
405 405
    long[] sig = object.getSignature().getArray();
......
591 591

  
592 592
///////////////////////////////////////////////////////////////////////////////////////////////////
593 593

  
594
  public String createObjectString(TwistyObject object,int numScramble, boolean isFree) throws JSONException
594
  public String createObjectString(TwistyObject object,int numScramble, int price) throws JSONException
595 595
    {
596 596
    JSONObject json = new JSONObject();
597 597

  
598
    JSONObject metadata    = generateMetadata(object,numScramble,isFree);
598
    JSONObject metadata    = generateMetadata(object,numScramble,price);
599 599
    JSONObject mesh        = generateMesh(object);
600 600
    JSONArray  axis        = generateAxis(object);
601 601
    JSONArray  quats       = generateQuats(object);
src/main/java/org/distorted/objectlib/main/ObjectType.java
23 23

  
24 24
public enum ObjectType
25 25
  {
26
  CUBE_2 ( TwistyCuboid.class        , 12, R.drawable.cube_2, true, true,  new InitData(new int[] {2,2,2})),
27
  CUBE_3 ( TwistyCuboid.class        , 17, R.drawable.cube_3, true, true,  new InitData(new int[] {3,3,3})),
28
  CUBE_4 ( TwistyCuboid.class        , 24, R.drawable.cube_4, true, false, new InitData(new int[] {4,4,4})),
29
  CUBE_5 ( TwistyCuboid.class        , 28, R.drawable.cube_5, true, false, new InitData(new int[] {5,5,5})),
30
  CUBE_6 ( TwistyCuboid.class        , 35, R.drawable.cube_6, true, false, new InitData(new int[] {6,6,6})),
31

  
32
  CUBE_7 ( TwistyCuboid.class        , 42, R.drawable.cube_7, true, false, new InitData(new int[] {7,7,7})),
33
  BAN1_3 ( TwistyBandagedCuboid.class, 16, R.drawable.ban1_3, true, true,  new InitData(new int[] {3,3,3}, TwistyBandagedCuboid.POS_1)),
34
  BAN2_3 ( TwistyBandagedCuboid.class, 20, R.drawable.ban2_3, true, false, new InitData(new int[] {3,3,3}, TwistyBandagedCuboid.POS_2)),
35
  BAN3_3 ( TwistyBandagedCuboid.class, 16, R.drawable.ban3_3, true, false, new InitData(new int[] {3,3,3}, TwistyBandagedCuboid.POS_3)),
36
  BAN4_3 ( TwistyBandagedCuboid.class, 22, R.drawable.ban4_3, true, false, new InitData(new int[] {3,3,3}, TwistyBandagedCuboid.POS_4)),
37

  
38
  CU_323 ( TwistyCuboid.class        , 15, R.drawable.cu_323, true, false, new InitData(new int[] {3,2,3})),
39
  CU_232 ( TwistyCuboid.class        , 16, R.drawable.cu_232, true, true,  new InitData(new int[] {2,3,2})),
40
  CU_343 ( TwistyCuboid.class        , 23, R.drawable.cu_343, true, false, new InitData(new int[] {3,4,3})),
41
  SQU1_3 ( TwistySquare1.class       , 24, R.drawable.squ1_3, true, false, new InitData(new int[] {3,2,3})),
42
  SQU2_3 ( TwistySquare2.class       , 24, R.drawable.squ2_3, true, false, new InitData(new int[] {3,2,3})),
43

  
44
  MORP_2 ( TwistyMorphix.class       , 12, R.drawable.morp_2, true, true,  new InitData(new int[] {2,2,2})),
45
  JING_2 ( TwistyJing.class          , 11, R.drawable.jing_2, true, false, new InitData(new int[] {2,2,2,2})),
46
  PYRA_3 ( TwistyPyraminx.class      , 10, R.drawable.pyra_3, true, true,  new InitData(new int[] {3,3,3,3})),
47
  PYRA_4 ( TwistyPyraminx.class      , 17, R.drawable.pyra_4, true, false, new InitData(new int[] {4,4,4,4})),
48
  PYRA_5 ( TwistyPyraminx.class      , 23, R.drawable.pyra_5, true, false, new InitData(new int[] {5,5,5,5})),
49

  
50
  TRAJ_3 ( TwistyTrajber.class       , 17, R.drawable.traj_3, true, false, new InitData(new int[] {3,3,3})),
51
  TRAJ_4 ( TwistyTrajber.class       , 24, R.drawable.traj_4, true, false, new InitData(new int[] {4,4,4})),
52
  DIAM_2 ( TwistyDiamond.class       , 12, R.drawable.diam_2, true, true,  new InitData(new int[] {2,2,2,2})),
53
  DIAM_3 ( TwistyDiamond.class       , 24, R.drawable.diam_3, true, false, new InitData(new int[] {3,3,3,3})),
54
  DIAM_4 ( TwistyDiamond.class       , 32, R.drawable.diam_4, true, false, new InitData(new int[] {4,4,4,4})),
55

  
56
  ULTI_2 ( TwistyUltimate.class      , 18, R.drawable.ulti_2, true, false, new InitData(new int[] {2,2,2,2})),
57
  KILO_3 ( TwistyKilominx.class      , 18, R.drawable.kilo_3, true, false, new InitData(new int[] {3,3,3,3,3,3})),
58
  MEGA_3 ( TwistyMegaminx.class      , 21, R.drawable.mega_3, true, true,  new InitData(new int[] {3,3,3,3,3,3})),
59
  KILO_5 ( TwistyKilominx.class      , 33, R.drawable.kilo_5, true, false, new InitData(new int[] {5,5,5,5,5,5})),
60
  MEGA_5 ( TwistyMegaminx.class      , 37, R.drawable.mega_5, true, false, new InitData(new int[] {5,5,5,5,5,5})),
61

  
62
  CRYS_3 ( TwistyCrystal.class       , 27, R.drawable.crys_3, true, false, new InitData(new int[] {3,3,3,3,3,3})),
63
  STAR_3 ( TwistyStarminx.class      , 27, R.drawable.star_3, true, false, new InitData(new int[] {3,3,3,3,3,3})),
64
  PENT_2 ( TwistyPentultimate.class  , 21, R.drawable.pent_2, true, false, new InitData(new int[] {2,2,2,2,2,2})),
65
  DINO_3 ( TwistyDino6.class         , 10, R.drawable.dino_3, true, true , new InitData(new int[] {3,3,3,3})),
66
  DIN4_3 ( TwistyDino4.class         ,  9, R.drawable.din4_3, true, false, new InitData(new int[] {3,3,3,3})),
67

  
68
  MIRR_2 ( TwistyMirror.class        , 12, R.drawable.mirr_2, true, true,  new InitData(new int[] {2,2,2})),
69
  MIRR_3 ( TwistyMirror.class        , 17, R.drawable.mirr_3, true, false, new InitData(new int[] {3,3,3})),
70
  MIRR_4 ( TwistyMirror.class        , 24, R.drawable.mirr_4, true, false, new InitData(new int[] {4,4,4})),
71
  IVY_2  ( TwistyIvy.class           ,  9, R.drawable.ivy_2 , true, true,  new InitData(new int[] {2,2,2,2})),
72
  REX_3  ( TwistyRex.class           , 19, R.drawable.rex_3 , true, false, new InitData(new int[] {3,3,3,3})),
73

  
74
  REDI_3 ( TwistyRedi.class          , 16, R.drawable.redi_3, true, true,  new InitData(new int[] {3,3,3,3})),
75
  HELI_3 ( TwistyHelicopter.class    , 20, R.drawable.heli_3, true, false, new InitData(new int[] {3,3,3,3,3,3})),
76
  SKEW_2 ( TwistySkewb.class         , 11, R.drawable.skew_2, true, true,  new InitData(new int[] {2,2,2,2})),
77
  SKEW_3 ( TwistySkewb.class         , 21, R.drawable.skew_3, true, false, new InitData(new int[] {3,3,3,3})),
78
  CONT_2 ( TwistyContainer.class     , 12, R.drawable.cont_2, true, false, new InitData(new int[] {2,2,2,2})),
79

  
80
  FISH_3 ( TwistyFisher.class        , 24, R.drawable.fish_3, true, false, new InitData(new int[] {3,3,3})),
81
  WIND_3 ( TwistyWindmill.class      , 24, R.drawable.wind_3, true, false, new InitData(new int[] {3,3,3})),
82
  AXIS_3 ( TwistyAxis.class          , 24, R.drawable.axis_3, true, false, new InitData(new int[] {3,3,3})),
83
  VOID_3 ( TwistyVoid.class          , 17, R.drawable.void_3, true, false, new InitData(new int[] {3,3,3})),
84
  MIXU_3 ( TwistyMixup3x3.class      , 24, R.drawable.mixu_3, true, false, new InitData(new int[] {3,3,3})),
85

  
86
  MIXP_3 ( TwistyMixup3x3Plus.class  , 28, R.drawable.mixp_3, true , false, new InitData(new int[] {3,3,3})),
87
  PDUO_2 ( TwistyPyraminxDuo.class   ,  4, R.drawable.pduo_2, false, false, new InitData(new int[] {2,2,2,2})),
88
  MORP_3 ( TwistyMorphix.class       , 17, R.drawable.morp_3, false, false, new InitData(new int[] {3,3,3})),
89
  MORP_4 ( TwistyMorphix.class       , 24, R.drawable.morp_4, false, false, new InitData(new int[] {4,4,4})),
90
  BALL_4 ( TwistyMasterball.class    , 28, R.drawable.ball_4, false, false, new InitData(new int[] {4,2,2,2,2})),
91

  
92
  CRA1_2 ( TwistyCrazy2x2.class      , 16, R.drawable.cra1_2, false, false, new InitData(new int[] {2,2,2})),
93
  CRA1_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra1_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.CRAZY  )),
94
  CRA2_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra2_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.MERCURY)),
95
  CRA3_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra3_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.VENUS  )),
96
  CRA4_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra4_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.EARTH  )),
97
  CRA5_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra5_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.MARS   )),
98
  CRA6_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra6_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.JUPITER)),
99
  CRA7_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra7_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.SATURN )),
100
  CRA8_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra8_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.URANUS )),
101
  CRA9_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra9_3, false, false, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.NEPTUNE)),
26
  CUBE_2 ( TwistyCuboid.class        , 12, R.drawable.cube_2, true,     0, new InitData(new int[] {2,2,2})),
27
  CUBE_3 ( TwistyCuboid.class        , 17, R.drawable.cube_3, true,     0, new InitData(new int[] {3,3,3})),
28
  CUBE_4 ( TwistyCuboid.class        , 24, R.drawable.cube_4, true,    50, new InitData(new int[] {4,4,4})),
29
  CUBE_5 ( TwistyCuboid.class        , 28, R.drawable.cube_5, true,    60, new InitData(new int[] {5,5,5})),
30
  CUBE_6 ( TwistyCuboid.class        , 35, R.drawable.cube_6, true,    70, new InitData(new int[] {6,6,6})),
31

  
32
  CUBE_7 ( TwistyCuboid.class        , 42, R.drawable.cube_7, true,   100, new InitData(new int[] {7,7,7})),
33
  BAN1_3 ( TwistyBandagedCuboid.class, 16, R.drawable.ban1_3, true,     0, new InitData(new int[] {3,3,3}, TwistyBandagedCuboid.POS_1)),
34
  BAN2_3 ( TwistyBandagedCuboid.class, 20, R.drawable.ban2_3, true,    50, new InitData(new int[] {3,3,3}, TwistyBandagedCuboid.POS_2)),
35
  BAN3_3 ( TwistyBandagedCuboid.class, 16, R.drawable.ban3_3, true,    50, new InitData(new int[] {3,3,3}, TwistyBandagedCuboid.POS_3)),
36
  BAN4_3 ( TwistyBandagedCuboid.class, 22, R.drawable.ban4_3, true,    60, new InitData(new int[] {3,3,3}, TwistyBandagedCuboid.POS_4)),
37

  
38
  CU_323 ( TwistyCuboid.class        , 15, R.drawable.cu_323, true,    40, new InitData(new int[] {3,2,3})),
39
  CU_232 ( TwistyCuboid.class        , 16, R.drawable.cu_232, true,     0, new InitData(new int[] {2,3,2})),
40
  CU_343 ( TwistyCuboid.class        , 23, R.drawable.cu_343, true,    50, new InitData(new int[] {3,4,3})),
41
  SQU1_3 ( TwistySquare1.class       , 24, R.drawable.squ1_3, true,    70, new InitData(new int[] {3,2,3})),
42
  SQU2_3 ( TwistySquare2.class       , 24, R.drawable.squ2_3, true,    70, new InitData(new int[] {3,2,3})),
43

  
44
  MORP_2 ( TwistyMorphix.class       , 12, R.drawable.morp_2, true,     0, new InitData(new int[] {2,2,2})),
45
  JING_2 ( TwistyJing.class          , 11, R.drawable.jing_2, true,    50, new InitData(new int[] {2,2,2,2})),
46
  PYRA_3 ( TwistyPyraminx.class      , 10, R.drawable.pyra_3, true,     0, new InitData(new int[] {3,3,3,3})),
47
  PYRA_4 ( TwistyPyraminx.class      , 17, R.drawable.pyra_4, true,    50, new InitData(new int[] {4,4,4,4})),
48
  PYRA_5 ( TwistyPyraminx.class      , 23, R.drawable.pyra_5, true,    70, new InitData(new int[] {5,5,5,5})),
49

  
50
  TRAJ_3 ( TwistyTrajber.class       , 17, R.drawable.traj_3, true,    50, new InitData(new int[] {3,3,3})),
51
  TRAJ_4 ( TwistyTrajber.class       , 24, R.drawable.traj_4, true,    60, new InitData(new int[] {4,4,4})),
52
  DIAM_2 ( TwistyDiamond.class       , 12, R.drawable.diam_2, true,     0, new InitData(new int[] {2,2,2,2})),
53
  DIAM_3 ( TwistyDiamond.class       , 24, R.drawable.diam_3, true,    60, new InitData(new int[] {3,3,3,3})),
54
  DIAM_4 ( TwistyDiamond.class       , 32, R.drawable.diam_4, true,    80, new InitData(new int[] {4,4,4,4})),
55

  
56
  ULTI_2 ( TwistyUltimate.class      , 18, R.drawable.ulti_2, true,    75, new InitData(new int[] {2,2,2,2})),
57
  KILO_3 ( TwistyKilominx.class      , 18, R.drawable.kilo_3, true,    50, new InitData(new int[] {3,3,3,3,3,3})),
58
  MEGA_3 ( TwistyMegaminx.class      , 21, R.drawable.mega_3, true,     0, new InitData(new int[] {3,3,3,3,3,3})),
59
  KILO_5 ( TwistyKilominx.class      , 33, R.drawable.kilo_5, true,    80, new InitData(new int[] {5,5,5,5,5,5})),
60
  MEGA_5 ( TwistyMegaminx.class      , 37, R.drawable.mega_5, true,   100, new InitData(new int[] {5,5,5,5,5,5})),
61

  
62
  CRYS_3 ( TwistyCrystal.class       , 27, R.drawable.crys_3, true,    70, new InitData(new int[] {3,3,3,3,3,3})),
63
  STAR_3 ( TwistyStarminx.class      , 27, R.drawable.star_3, true,    80, new InitData(new int[] {3,3,3,3,3,3})),
64
  PENT_2 ( TwistyPentultimate.class  , 21, R.drawable.pent_2, true,    80, new InitData(new int[] {2,2,2,2,2,2})),
65
  DINO_3 ( TwistyDino6.class         , 10, R.drawable.dino_3, true,     0, new InitData(new int[] {3,3,3,3})),
66
  DIN4_3 ( TwistyDino4.class         ,  9, R.drawable.din4_3, true,    30, new InitData(new int[] {3,3,3,3})),
67

  
68
  MIRR_2 ( TwistyMirror.class        , 12, R.drawable.mirr_2, true,     0, new InitData(new int[] {2,2,2})),
69
  MIRR_3 ( TwistyMirror.class        , 17, R.drawable.mirr_3, true,    50, new InitData(new int[] {3,3,3})),
70
  MIRR_4 ( TwistyMirror.class        , 24, R.drawable.mirr_4, true,    60, new InitData(new int[] {4,4,4})),
71
  IVY_2  ( TwistyIvy.class           ,  9, R.drawable.ivy_2 , true,     0, new InitData(new int[] {2,2,2,2})),
72
  REX_3  ( TwistyRex.class           , 19, R.drawable.rex_3 , true,    70, new InitData(new int[] {3,3,3,3})),
73

  
74
  REDI_3 ( TwistyRedi.class          , 16, R.drawable.redi_3, true,     0, new InitData(new int[] {3,3,3,3})),
75
  HELI_3 ( TwistyHelicopter.class    , 20, R.drawable.heli_3, true,    80, new InitData(new int[] {3,3,3,3,3,3})),
76
  SKEW_2 ( TwistySkewb.class         , 11, R.drawable.skew_2, true,     0, new InitData(new int[] {2,2,2,2})),
77
  SKEW_3 ( TwistySkewb.class         , 21, R.drawable.skew_3, true,    70, new InitData(new int[] {3,3,3,3})),
78
  CONT_2 ( TwistyContainer.class     , 12, R.drawable.cont_2, true,    40, new InitData(new int[] {2,2,2,2})),
79

  
80
  FISH_3 ( TwistyFisher.class        , 24, R.drawable.fish_3, true,    50, new InitData(new int[] {3,3,3})),
81
  WIND_3 ( TwistyWindmill.class      , 24, R.drawable.wind_3, true,    50, new InitData(new int[] {3,3,3})),
82
  AXIS_3 ( TwistyAxis.class          , 24, R.drawable.axis_3, true,    60, new InitData(new int[] {3,3,3})),
83
  VOID_3 ( TwistyVoid.class          , 17, R.drawable.void_3, true,    70, new InitData(new int[] {3,3,3})),
84
  MIXU_3 ( TwistyMixup3x3.class      , 24, R.drawable.mixu_3, true,    70, new InitData(new int[] {3,3,3})),
85

  
86
  MIXP_3 ( TwistyMixup3x3Plus.class  , 28, R.drawable.mixp_3, true ,   70, new InitData(new int[] {3,3,3})),
87
  PDUO_2 ( TwistyPyraminxDuo.class   ,  4, R.drawable.pduo_2, false,    0, new InitData(new int[] {2,2,2,2})),
88
  MORP_3 ( TwistyMorphix.class       , 17, R.drawable.morp_3, false,   60, new InitData(new int[] {3,3,3})),
89
  MORP_4 ( TwistyMorphix.class       , 24, R.drawable.morp_4, false,   70, new InitData(new int[] {4,4,4})),
90
  BALL_4 ( TwistyMasterball.class    , 28, R.drawable.ball_4, false,   70, new InitData(new int[] {4,2,2,2,2})),
91

  
92
  CRA1_2 ( TwistyCrazy2x2.class      , 16, R.drawable.cra1_2, false,   50, new InitData(new int[] {2,2,2})),
93
  CRA1_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra1_3, false,   50, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.CRAZY  )),
94
  CRA2_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra2_3, false,   80, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.MERCURY)),
95
  CRA3_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra3_3, false,   80, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.VENUS  )),
96
  CRA4_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra4_3, false,   80, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.EARTH  )),
97
  CRA5_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra5_3, false,   80, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.MARS   )),
98
  CRA6_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra6_3, false,   60, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.JUPITER)),
99
  CRA7_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra7_3, false,   80, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.SATURN )),
100
  CRA8_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra8_3, false,   60, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.URANUS )),
101
  CRA9_3 ( TwistyCrazy3x3.class      , 22, R.drawable.cra9_3, false,   80, new InitData(new int[] {3,3,3}, TwistyCrazy3x3.NEPTUNE)),
102 102
  ;
103 103

  
104 104
  public static int NUM_OBJECTS;
105
  public static final int DEFAULT_PRICE_OF_OLD_OBJECTS = 50;
105 106
  public static final int MAX_SCRAMBLES = 42;  // max scrambles at the time we switched from
106 107
                                               // remembering the records the old way
107 108
  private static final ObjectType[] objects;
......
110 111
  private final int mNumScrambles;
111 112
  private final int mIcon;
112 113
  private final boolean mExportToApp;
113
  private final boolean mIsFree;
114
  private final int mPrice;
114 115
  private final Class<? extends TwistyObject> mClass;
115 116

  
116 117
  static
......
125 126

  
126 127
///////////////////////////////////////////////////////////////////////////////////////////////////
127 128

  
128
  ObjectType(Class<? extends TwistyObject> clazz, int scrambles, int icon, boolean export, boolean isFree, InitData data)
129
  ObjectType(Class<? extends TwistyObject> clazz, int scrambles, int icon, boolean export, int price, InitData data)
129 130
    {
130 131
    mClass       = clazz;
131 132
    mInitData    = data;
132 133
    mNumScrambles= scrambles;
133 134
    mIcon        = icon;
134 135
    mExportToApp = export;
135
    mIsFree      = isFree;
136
    mPrice       = price;
136 137
    }
137 138

  
138 139
///////////////////////////////////////////////////////////////////////////////////////////////////
......
171 172

  
172 173
///////////////////////////////////////////////////////////////////////////////////////////////////
173 174

  
174
  public boolean isFree()
175
  public int getPrice()
175 176
    {
176
    return mIsFree;
177
    return mPrice;
177 178
    }
178 179

  
179 180
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff