Commit 6966a952 authored by Bošániová Monika's avatar Bošániová Monika
Browse files

Small changes

parent 451c69fa
......@@ -9,15 +9,14 @@ public class Automate : MonoBehaviour
private static List<string> moveList = new List<string>() { };
private static MovesCollection movelist = new MovesCollection();
private static MovesIterator movelistIterator = new MovesIterator(movelist);
public GameObject rubicsCube;
public GameObject cubeMap;
public GameObject ClickableRotator;
//static List<string> undoMoveList = new List<string>() { };
public static int actualPosition = 0;
public static bool shuffleDone = false;
public static bool AutomatePlaying = false;
//bool automateRotation = false;
//CubeMapMatrix cubeMap;
Colors side = Colors.Blue;
private GameObject movingParts;
......@@ -33,13 +32,12 @@ public class Automate : MonoBehaviour
};
private CubeState cubeState;
//private ReadCube readCube;
// Start is called before the first frame update
void Start()
{
cubeState = FindObjectOfType<CubeState>();
//cubeMap = CubeMapMatrix.CubeMatrix;
CubeState.started = true;
movingParts = new GameObject();
}
......@@ -130,8 +128,6 @@ public class Automate : MonoBehaviour
public void Shuffle()
{
//dopisat aby sa negenerovali opacne
List<string> moves = new List<string>();
int shuffleLength = UnityEngine.Random.Range(10, 30);
for (int i = 0; i < shuffleLength; i++)
......@@ -149,16 +145,7 @@ public class Automate : MonoBehaviour
}
print(tmp);
shuffleDone = true;
//actualPosition = 0;
//ClickableRotator.SetActive(false);
AutomatePlaying = true;
//moveList = new List<string>();
//moveList = new List<string>() { "F'", "L2", "D'", "B", "U'", "F", "U", "L'", "F2", "U'", "R2", "L'", "D2", "D2", "R2", "R", "B'", "L", "F2", "F", "D2", "L'", "U", "R2", "R'", "L'", "B2", "L", "U'", "R'", "R2" };
//moveList = new List<string>() { "F'"};
}
......@@ -260,7 +247,6 @@ public class Automate : MonoBehaviour
// set parent back
foreach (Transform child in childsToEdit)
child.SetParent(movingParts.transform);
//print(movingParts.transform.childCount + " hehe");
RotateSide();
}
......@@ -353,6 +339,5 @@ public class Automate : MonoBehaviour
{
movelist.AddCollection(moves);
movelistIterator.Reset();
//moveList = moves;
}
}
......@@ -18,13 +18,12 @@ abstract class Iterator : IEnumerator
//Move one step back
public abstract bool MoveBack();
//Return to the start position
public abstract void Reset();
}
abstract class IteratorAggregate : IEnumerable
{
// Returns an Iterator or another IteratorAggregate for the implementing
// object.
public abstract IEnumerator GetEnumerator();
}
......@@ -32,17 +31,12 @@ class MovesIterator : Iterator
{
private MovesCollection _collection;
// Stores the current traversal position. An iterator may have a lot of
// other fields for storing iteration state, especially when it is
// supposed to work with a particular kind of collection.
private int _position = -1;
//private bool _reverse = false;
public MovesIterator(MovesCollection collection)
{
this._collection = collection;
//this._reverse = reverse;
}
public override object Current()
......@@ -91,8 +85,6 @@ class MovesIterator : Iterator
}
}
// Concrete Collections provide one or several methods for retrieving fresh
// iterator instances, compatible with the collection class.
class MovesCollection : IteratorAggregate
{
List<string> _collection = new List<string>();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment