Beispiel #1
0
 public InitialRubixCubeBuilder()
 {
     cubesWith1Face       = new FixedLengthSet <CubeWith1Face>(RubixCube.NumberOfCubesWith1Face);
     cubesWith2Faces      = new FixedLengthSet <CubeWith2Faces>(RubixCube.NumberOfCubesWith2Faces);
     cubesWith3Faces      = new FixedLengthSet <CubeWith3Faces>(RubixCube.NumebrOfCubesWith3Faces);
     frontCube            = new CubeWith1Face();
     topCube              = new CubeWith1Face();
     bottomCube           = new CubeWith1Face();
     leftCube             = new CubeWith1Face();
     rightCube            = new CubeWith1Face();
     backCube             = new CubeWith1Face();
     frontTopCube         = new CubeWith2Faces();
     frontLeftCube        = new CubeWith2Faces();
     frontRightCube       = new CubeWith2Faces();
     frontBottomCube      = new CubeWith2Faces();
     leftTopCube          = new CubeWith2Faces();
     leftBottomCube       = new CubeWith2Faces();
     rightTopCube         = new CubeWith2Faces();
     rightBottomCube      = new CubeWith2Faces();
     backTopCube          = new CubeWith2Faces();
     backLeftCube         = new CubeWith2Faces();
     backRightCube        = new CubeWith2Faces();
     backBottomCube       = new CubeWith2Faces();
     frontTopLeftCube     = new CubeWith3Faces();
     frontTopRightCube    = new CubeWith3Faces();
     frontBottomLeftCube  = new CubeWith3Faces();
     frontBottomRightCube = new CubeWith3Faces();
     backTopLeftCube      = new CubeWith3Faces();
     backTopRightCube     = new CubeWith3Faces();
     backBottomLeftCube   = new CubeWith3Faces();
     backBottomRightCube  = new CubeWith3Faces();
     InitializeRubixCube();
 }
        internal void RemoveCubeWith2Faces(CubeWith2Faces cube)
        {
            if (!cubesWith2Faces.Remove(cube))
            {
                throw new InvalidOperationException("cube was not found in set");
            }

            cube.RemoveCubeWith1Face(this);
        }
 internal void AddCubeWith2Faces(CubeWith2Faces cube)
 {
     cubesWith2Faces.Add(cube);
     cube.AddCubeWith1Face(this);
 }