Project

General

Profile

« Previous | Next » 

Revision da57afae

Added by Leszek Koltunski about 1 year ago

Move opening local files to the OSInterface

View differences:

src/main/java/org/distorted/solvers/SolverTablebase.java
11 11

  
12 12
import android.content.res.Resources;
13 13

  
14
import org.distorted.objectlib.helpers.OperatingSystemInterface;
14 15
import org.distorted.objectlib.main.TwistyObject;
15 16
import org.distorted.screens.RubikScreenSolver;
16 17

  
......
18 19

  
19 20
public abstract class SolverTablebase
20 21
{
22
  private final OperatingSystemInterface mOS;
21 23
  private final Resources mRes;
22 24
  private final TwistyObject mObject;
23 25

  
......
25 27

  
26 28
  public abstract int tablebaseIndex(TwistyObject object);
27 29
  public abstract String error(int index, Resources res);
28
  public abstract int[][] solution(int index, Resources res);
30
  public abstract int[][] solution(int index, OperatingSystemInterface os);
29 31

  
30 32
///////////////////////////////////////////////////////////////////////////////////////////////////
31 33
// PUBLIC API
32 34
///////////////////////////////////////////////////////////////////////////////////////////////////
33 35

  
34
  public SolverTablebase(Resources res, TwistyObject object)
36
  public SolverTablebase(OperatingSystemInterface os, Resources res, TwistyObject object)
35 37
    {
38
    mOS    = os;
36 39
    mRes   = res;
37 40
    mObject= object;
38 41
    }
......
45 48

  
46 49
    if( index>=0 )
47 50
      {
48
      int[][] moves = solution(index,mRes);
51
      int[][] moves = solution(index,mOS);
49 52
      screen.setSolved(moves);
50 53
      }
51 54
    else

Also available in: Unified diff