Project

General

Profile

« Previous | Next » 

Revision eb9263dd

Added by Leszek Koltunski 11 months ago

Next step toward separating TwistyObject metadata.

View differences:

build.gradle
59 59
    implementation ('androidx.work:work-runtime:2.8.1')
60 60
    implementation ('com.google.android.material:material:1.10.0')
61 61
    //implementation "com.android.billingclient:billing:5.1.0"
62
    implementation project(path: ':distorted-component-jsons')
63
    implementation project(path: ':distorted-component-dmesh')
64 62
    implementation project(path: ':distorted-os-android')
65 63
}
src/main/java/org/distorted/external/RubikScores.java
22 22
import org.distorted.objects.RubikObject;
23 23
import org.distorted.objects.RubikObjectList;
24 24

  
25
import static org.distorted.objectlib.main.ObjectType.MAX_SCRAMBLES;
25
import static org.distorted.objectlib.metadata.ListObjects.MAX_SCRAMBLES;
26 26

  
27 27
///////////////////////////////////////////////////////////////////////////////////////////////////
28 28
// hold my own scores, and some other statistics.
src/main/java/org/distorted/objects/RubikObject.java
22 22

  
23 23
import androidx.appcompat.content.res.AppCompatResources;
24 24

  
25
import org.distorted.dmesh.ObjectMesh;
26 25
import org.distorted.external.RubikFiles;
27
import org.distorted.jsons.ObjectJson;
28 26
import org.distorted.main.R;
29
import org.distorted.objectlib.main.ObjectType;
27
import org.distorted.objectlib.metadata.ListObjects;
30 28
import org.distorted.objectlib.metadata.Metadata;
31 29
import org.distorted.objectlib.patterns.RubikPatternList;
32 30
import org.distorted.solvers.ImplementedSolversList;
......
53 51

  
54 52
///////////////////////////////////////////////////////////////////////////////////////////////////
55 53

  
56
  RubikObject(ObjectType type)
54
  RubikObject(ListObjects type)
57 55
    {
58 56
    Metadata meta = type.getMetadata();
59 57
    mObjectOrdinal= type.ordinal();
......
64 62
    mPrice       = meta.price();
65 63
    mIsFree      = mPrice==0;
66 64
    mIconID      = meta.icon();
67
    mJsonID      = ObjectJson.getObjectJsonID(mObjectOrdinal);
68
    mMeshID      = ObjectMesh.getMeshID(mObjectOrdinal);
69
    mExtrasID    = ObjectJson.getExtrasJsonID(mObjectOrdinal);
65
    mJsonID      = meta.objectJson();
66
    mMeshID      = meta.mesh();
67
    mExtrasID    = meta.extrasJson();
70 68
    mIsLocal     = false;
71 69

  
72 70
    int patternOrdinal  = RubikPatternList.getOrdinal(mObjectOrdinal);
src/main/java/org/distorted/objects/RubikObjectList.java
17 17

  
18 18
import org.distorted.external.RubikFiles;
19 19
import org.distorted.external.RubikScores;
20
import org.distorted.objectlib.main.ObjectType;
20
import org.distorted.objectlib.metadata.ListObjects;
21 21

  
22
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
22
import static org.distorted.objectlib.metadata.ListObjects.NUM_OBJECTS;
23 23

  
24 24
///////////////////////////////////////////////////////////////////////////////////////////////////
25 25

  
......
84 84
    {
85 85
    for(int i=0; i<NUM_OBJECTS; i++)
86 86
      {
87
      ObjectType type = ObjectType.getObject(i);
87
      ListObjects type = ListObjects.getObject(i);
88 88
      RubikObject obj = new RubikObject(type);
89 89
      mObjects.add(obj);
90 90
      mNumObjects++;
......
365 365
            {
366 366
            char c = parts[7].charAt(0);
367 367
            if( c=='t' )      price = 0;
368
            else if( c=='f' ) price = ObjectType.DEFAULT_PRICE_OF_OLD_OBJECTS;
368
            else if( c=='f' ) price = ListObjects.DEFAULT_PRICE_OF_OLD_OBJECTS;
369 369
            else              price = Integer.parseInt(parts[7]);
370 370
            }
371 371

  
src/main/java/org/distorted/solvers/SolverCube2.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
288 288
    {
289 289
    if( mSolver==null )
290 290
      {
291
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.CUBE_2.name() );
291
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.CUBE_2.name() );
292 292
      }
293 293

  
294 294
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverCuboid232.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
409 409
    {
410 410
    if( mSolver==null )
411 411
      {
412
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.CU_232.name() );
412
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.CU_232.name() );
413 413
      }
414 414

  
415 415
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverCuboid323.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TBCuboid323;
......
446 446
    {
447 447
    if( mSolver==null )
448 448
      {
449
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.CU_323.name() );
449
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.CU_323.name() );
450 450
      }
451 451

  
452 452
    ((TBCuboid323)mSolver).initialize();
src/main/java/org/distorted/solvers/SolverDino4.java
15 15

  
16 16
import org.distorted.main.R;
17 17
import org.distorted.objectlib.helpers.OperatingSystemInterface;
18
import org.distorted.objectlib.main.ObjectType;
18
import org.distorted.objectlib.metadata.ListObjects;
19 19
import org.distorted.objectlib.main.TwistyObject;
20 20
import org.distorted.objectlib.shape.ShapeHexahedron;
21 21
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
......
177 177
    {
178 178
    if( mSolver==null )
179 179
      {
180
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.DIN4_3.name() );
180
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.DIN4_3.name() );
181 181
      }
182 182

  
183 183
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverDino6.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TBDino6;
......
442 442
    {
443 443
    if( mSolver==null )
444 444
      {
445
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.DINO_3.name() );
445
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.DINO_3.name() );
446 446
      }
447 447

  
448 448
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverIvyCube.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
245 245
    {
246 246
    if( mSolver==null )
247 247
      {
248
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.IVY_2.name() );
248
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.IVY_2.name() );
249 249
      }
250 250

  
251 251
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverJing.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TBPyraminx;
......
527 527
    {
528 528
    if( mSolver==null )
529 529
      {
530
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.JING_2.name());
530
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.JING_2.name());
531 531
      }
532 532

  
533 533
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverPyraminx.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
540 540
    {
541 541
    if( mSolver==null )
542 542
      {
543
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.PYRA_3.name());
543
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.PYRA_3.name());
544 544
      }
545 545

  
546 546
    return mSolver!=null ? mSolver.solution(index,mCornerTwist,os) : null;
src/main/java/org/distorted/solvers/SolverPyraminxDiamond.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
366 366
    {
367 367
    if( mSolver==null )
368 368
      {
369
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.PDIA_3.name() );
369
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.PDIA_3.name() );
370 370
      }
371 371

  
372 372
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverPyraminxDuo.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TablebasesAbstract;
......
290 290
    {
291 291
    if( mSolver==null )
292 292
      {
293
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.PDUO_2.name() );
293
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.PDUO_2.name() );
294 294
      }
295 295

  
296 296
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverSkewb.java
16 16

  
17 17
import org.distorted.main.R;
18 18
import org.distorted.objectlib.helpers.OperatingSystemInterface;
19
import org.distorted.objectlib.main.ObjectType;
19
import org.distorted.objectlib.metadata.ListObjects;
20 20
import org.distorted.objectlib.main.TwistyObject;
21 21
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
22 22
import org.distorted.objectlib.tablebases.TBSkewb;
......
442 442
    {
443 443
    if( mSolver==null )
444 444
      {
445
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.SKEW_2.name() );
445
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.SKEW_2.name() );
446 446
      }
447 447

  
448 448
    return mSolver!=null ? mSolver.solution(index,null,os) : null;
src/main/java/org/distorted/solvers/SolverSkewbDiamond.java
13 13

  
14 14
import org.distorted.main.R;
15 15
import org.distorted.objectlib.helpers.OperatingSystemInterface;
16
import org.distorted.objectlib.main.ObjectType;
16
import org.distorted.objectlib.metadata.ListObjects;
17 17
import org.distorted.objectlib.main.TwistyObject;
18 18
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
19 19
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
503 503
    {
504 504
    if( mSolver==null )
505 505
      {
506
      mSolver = ImplementedTablebasesList.createPacked(os, ObjectType.DIAM_2.name());
506
      mSolver = ImplementedTablebasesList.createPacked(os, ListObjects.DIAM_2.name());
507 507
      }
508 508

  
509 509
    return mSolver!=null ? mSolver.solution(index,null,os) : null;

Also available in: Unified diff