Project

General

Profile

« Previous | Next » 

Revision 9c028ec3

Added by Leszek Koltunski 8 months ago

ghost-releted changes to the JSON !

View differences:

src/main/java/org/distorted/objectlib/json/JsonReader.java
97 97
  private int[][] mMinimalCubitsInRow;
98 98
  private boolean mSupportsAdjustableColors;
99 99
  private int mGhostAngle;
100
  private int[] mGhostFirstRow;
100
  private int[] mGhostRowState;
101 101
  private int mGhostAxis;
102 102

  
103 103
///////////////////////////////////////////////////////////////////////////////////////////////////
......
209 209
    if( firstRow!=null )
210 210
      {
211 211
      int size = firstRow.length();
212
      mGhostFirstRow = new int[size];
213
      for(int i=0; i<size; i++) mGhostFirstRow[i] = firstRow.getInt(i);
212
      mGhostRowState = new int[size];
213
      for(int i=0; i<size; i++) mGhostRowState[i] = firstRow.getInt(i);
214 214
      }
215 215
    }
216 216

  
......
1137 1137
  public String getTutorialObject()                    { return mTutorialObject; }
1138 1138
  public String[][] getTutorials()                     { return mTutorials; }
1139 1139
  public int getGhostAngle()                           { return mGhostAngle; }
1140
  public int[] getGhostFirstRow()                      { return mGhostFirstRow; }
1140
  public int[] getGhostRowState()                      { return mGhostRowState; }
1141 1141
  public int getGhostAxis()                            { return mGhostAxis; }
1142 1142
  public String printColor(int color)                  { return color>=0 ? ShapeColors.getColorName(mColorTable[color]) : "UNKNOWN"; }
1143 1143
}
src/main/java/org/distorted/objectlib/json/JsonWriter.java
438 438
    metadata.put("ghostAngle" , object.getGhostAngle() );
439 439
    metadata.put("ghostAxis"  , object.getGhostAxis() );
440 440

  
441
    int[] firstRow = object.getGhostFirstRow();
442
    if( firstRow!=null )
441
    int[] rowState = object.getGhostRowState();
442
    if( rowState!=null )
443 443
      {
444 444
      JSONArray firstArray = new JSONArray();
445
      for(int f : firstRow ) firstArray.put(f);
445
      for(int f : rowState ) firstArray.put(f);
446 446
      metadata.put("ghostRow", firstArray);
447 447
      }
448 448

  
src/main/java/org/distorted/objectlib/main/TwistyJson.java
58 58
  @Override public int getInternalColor()                            { return mReader.getInternalColor(); }
59 59
  @Override public float[][] returnRotationFactor()                  { return mReader.returnRotationFactor(); }
60 60
  @Override public int getGhostAngle()                               { return mReader.getGhostAngle(); }
61
  @Override public int[] getGhostFirstRow()                          { return mReader.getGhostFirstRow(); }
61
  @Override public int[] getGhostRowState()                          { return mReader.getGhostRowState(); }
62 62
  @Override public int getGhostAxis()                                { return mReader.getGhostAxis(); }
63 63

  
64 64
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff