Project

General

Profile

« Previous | Next » 

Revision 2876aeb6

Added by Leszek Koltunski over 1 year ago

Tablebase-based scrambling.

View differences:

src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java
276 276
      {
277 277
      RubikFiles files = RubikFiles.getInstance();
278 278
      InputStream jsonStream = files.openFile(this,name+"_object.json");
279
      InitAssets assets = new InitAssets(jsonStream,null);
279
      InitAssets assets = new InitAssets(jsonStream,null,null);
280 280

  
281 281
      if( !assets.noJsonStream() )
282 282
        {
src/main/java/org/distorted/bandaged/BandagedPlayActivity.java
241 241
      int meshState          = TwistyObject.MESH_NICE;
242 242
      int iconMode           = TwistyObject.MODE_NORM;
243 243
      InputStream jsonStream = files.openFile(this,name+"_object.json");
244
      InitAssets asset       = new InitAssets(jsonStream,null);
244
      InitAssets asset       = new InitAssets(jsonStream,null,null);
245 245
      int ordinal            = 0; // if jsonStream!=null, this doesn't matter
246 246

  
247 247
      control.changeIfDifferent(ordinal,name,meshState,iconMode,asset);
src/main/java/org/distorted/config/ConfigActivity.java
195 195
        InputStream jsonStream = object.getObjectStream(this);
196 196
        InputStream meshStream = object.getMeshStream(this);
197 197
        String name            = object.getUpperName();
198
        InitAssets asset       = new InitAssets(jsonStream,meshStream);
198
        InitAssets asset       = new InitAssets(jsonStream,meshStream,null);
199 199
        control.changeIfDifferent(ordinal,name,meshState,iconMode,asset);
200 200
        }
201 201
      }
......
226 226
        int iconMode           = TwistyObject.MODE_NORM;
227 227
        InputStream jsonStream = object.getObjectStream(this);
228 228
        InputStream meshStream = object.getMeshStream(this);
229
        InitAssets asset       = new InitAssets(jsonStream,meshStream);
229
        InitAssets asset       = new InitAssets(jsonStream,meshStream,null);
230 230

  
231 231
        control.changeObject(ordinal,meshState,iconMode,asset);
232 232
        }
src/main/java/org/distorted/main/RubikActivity.java
613 613
      InputStream jsonStream = object==null ? null : object.getObjectStream(this);
614 614
      InputStream meshStream = object==null ? null : object.getMeshStream(this);
615 615
      String name = object==null ? "NULL" : object.getUpperName();
616
      InitAssets asset = new InitAssets(jsonStream,meshStream);
616
      InitAssets asset = new InitAssets(jsonStream,meshStream,getResources());
617 617

  
618 618
      control.changeIfDifferent(ordinal,name,meshState,iconMode,asset);
619 619
      }
......
736 736
          int iconMode  = TwistyObject.MODE_NORM;
737 737
          InputStream jsonStream = object.getObjectStream(this);
738 738
          InputStream meshStream = object.getMeshStream(this);
739
          InitAssets asset       = new InitAssets(jsonStream,meshStream);
739
          InitAssets asset       = new InitAssets(jsonStream,meshStream,getResources());
740 740
          ObjectControl control = getControl();
741 741
          control.changeObject(-1,meshState,iconMode,asset);
742 742
          }
src/main/java/org/distorted/purchase/PurchaseActivity.java
233 233
        InputStream jsonStream = object.getObjectStream(this);
234 234
        InputStream meshStream = object.getMeshStream(this);
235 235
        String name            = object.getUpperName();
236
        InitAssets asset       = new InitAssets(jsonStream,meshStream);
236
        InitAssets asset       = new InitAssets(jsonStream,meshStream,null);
237 237
        control.changeIfDifferent(ordinal,name,meshState,iconMode,asset);
238 238
        }
239 239
      }
src/main/java/org/distorted/solvers/SolverCuboid232.java
12 12
import android.content.res.Resources;
13 13

  
14 14
import org.distorted.main.R;
15
import org.distorted.objectlib.main.ObjectType;
15
import org.distorted.objectlib.main.ObjectSignatures;
16 16
import org.distorted.objectlib.main.TwistyObject;
17 17
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
18 18
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
424 424
    {
425 425
    if( mSolver==null )
426 426
      {
427
      mSolver = ImplementedTablebasesList.createPacked(res,ObjectType.CU_232);
427
      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.CU_232);
428 428
      }
429 429

  
430 430
    return mSolver!=null ? mSolver.solution(index) : null;
src/main/java/org/distorted/solvers/SolverIvyCube.java
12 12
import android.content.res.Resources;
13 13

  
14 14
import org.distorted.main.R;
15
import org.distorted.objectlib.main.ObjectType;
15
import org.distorted.objectlib.main.ObjectSignatures;
16 16
import org.distorted.objectlib.main.TwistyObject;
17 17
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
18 18
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
244 244
    {
245 245
    if( mSolver==null )
246 246
      {
247
      mSolver = ImplementedTablebasesList.createPacked(res,ObjectType.IVY_2);
247
      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.IVY_2);
248 248
      }
249 249

  
250 250
    return mSolver!=null ? mSolver.solution(index) : null;
src/main/java/org/distorted/solvers/SolverPyraminx.java
12 12
import android.content.res.Resources;
13 13

  
14 14
import org.distorted.main.R;
15
import org.distorted.objectlib.main.ObjectType;
15
import org.distorted.objectlib.main.ObjectSignatures;
16 16
import org.distorted.objectlib.main.TwistyObject;
17 17
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
18 18
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
555 555
    {
556 556
    if( mSolver==null )
557 557
      {
558
      mSolver = ImplementedTablebasesList.createPacked(res,ObjectType.PYRA_3);
558
      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.PYRA_3);
559 559
      }
560 560

  
561 561
    int[][] moves1 = mSolver!=null ? mSolver.solution(index) : null;
src/main/java/org/distorted/solvers/SolverPyraminxDuo.java
12 12
import android.content.res.Resources;
13 13

  
14 14
import org.distorted.main.R;
15
import org.distorted.objectlib.main.ObjectType;
15
import org.distorted.objectlib.main.ObjectSignatures;
16 16
import org.distorted.objectlib.main.TwistyObject;
17 17
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
18 18
import org.distorted.objectlib.tablebases.TablebasesAbstract;
......
289 289
    {
290 290
    if( mSolver==null )
291 291
      {
292
      mSolver = ImplementedTablebasesList.createPacked(res,ObjectType.PDUO_2);
292
      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.PDUO_2);
293 293
      }
294 294

  
295 295
    return mSolver!=null ? mSolver.solution(index) : null;
src/main/java/org/distorted/solvers/SolverSkewbDiamond.java
12 12
import android.content.res.Resources;
13 13

  
14 14
import org.distorted.main.R;
15
import org.distorted.objectlib.main.ObjectType;
15
import org.distorted.objectlib.main.ObjectSignatures;
16 16
import org.distorted.objectlib.main.TwistyObject;
17 17
import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
18 18
import org.distorted.objectlib.tablebases.TablebaseHelpers;
......
490 490
    {
491 491
    if( mSolver==null )
492 492
      {
493
      mSolver = ImplementedTablebasesList.createPacked(res,ObjectType.DIAM_2);
494

  
495
      //mSolver = ImplementedTablebasesList.createUnpacked(ObjectType.DIAM_2);
496
      //if( mSolver!=null ) mSolver.createTablebase();
493
      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.DIAM_2);
497 494
      }
498 495

  
499 496
    return mSolver!=null ? mSolver.solution(index) : null;
src/main/java/org/distorted/tutorials/TutorialActivity.java
226 226
      InputStream jsonStream = object==null ? null : object.getObjectStream(this);
227 227
      InputStream meshStream = object==null ? null : object.getMeshStream(this);
228 228
      String name = object==null ? "NULL" : object.getUpperName();
229
      InitAssets asset = new InitAssets(jsonStream,meshStream);
229
      InitAssets asset = new InitAssets(jsonStream,meshStream,getResources());
230 230
      control.changeIfDifferent(ordinal,name,meshState,iconMode,asset);
231 231
      }
232 232

  

Also available in: Unified diff