Project

General

Profile

« Previous | Next » 

Revision a332f7a4

Added by Leszek Koltunski 9 months ago

progress with Ghosts

View differences:

src/main/java/org/distorted/objectlib/main/TwistyObjectSolved.java
147 147

  
148 148
  boolean isSolved()
149 149
    {
150
    if( mGhostAxis!=0 && !mGhostBlocked ) return false; // ghosts need to be in the 'blocked' state
151
                                                        // [i.e. initial] to be considered solved
150
    if( mGhostAngle!=0 && !mGhostOuterShapeOk ) return false;
152 151

  
153 152
    for(int c=0; c<mNumCubits; c++) mCubitQuats[c] = getCubitQuatIndex(c);
154 153

  
src/main/java/org/distorted/objectlib/main/TwistyObjectTheoretical.java
44 44
  private float[][] mCubitOffset;
45 45

  
46 46
  // only for Ghosts
47
  protected int mGhostAxis;        // the index of the axis of rotations along which the ghost
48
                                   // can always move. Currently always hardcoded to 0.
49
  protected int mGhostAngle;       // in degrees!
50
  protected int mGhostFirstRow;    // Every ghost has two kinds of rows along its mGhostAxis:
51
                                   // 'left' ones (normal) and 'right' ones (blocking). FirstRow is
52
                                   // the number of the first right row.
53
  protected boolean mGhostBlocked; // if true, all rotations along axis different than mGhostAxis
54
                                   // are blocked.
47
  protected int mGhostAxis;             // the index of the axis of rotations along which the ghost
48
                                        // can always move. Currently always hardcoded to 0.
49
  protected int mGhostAngle;            // in degrees!
50
  protected int mGhostFirstRow;         // Every ghost has two kinds of rows along its mGhostAxis:
51
                                        // 'left' ones (normal) and 'right' ones (blocking). FirstRow is
52
                                        // the number of the first right row.
53
  protected boolean mGhostBlocked;      // if true, all rotations along axis different than mGhostAxis
54
                                        // are blocked.
55
  protected boolean mGhostOuterShapeOk; // is the outer shape of the ghost puzzle currently 'ok' i.e.
56
                                        // the same like in the beginning? then we are solved!
55 57

  
56 58
///////////////////////////////////////////////////////////////////////////////////////////////////
57 59

  
src/main/java/org/distorted/objectlib/objects/TwistyTestGhost.java
29 29

  
30 30
public class TwistyTestGhost extends ShapeHexahedron
31 31
{
32
  private static final int GHOST_ANGLE = 30;
32
  private static final int GHOST_ANGLE = 20;
33 33

  
34 34
  static final Static3D[] ROT_AXIS = new Static3D[]
35 35
         {

Also available in: Unified diff