Example #1
0
        public Center(CenterPiece piece)
        {
            var cubies = new List <CenterPiece>();

            for (int i = 0; i < 4; i++)
            {
                cubies.Add(piece);
            }
            Cubies = cubies.ToArray();
        }
Example #2
0
    void Initialize()
    {
        for(int x = 0; x < CUBE_SIZE; x++)
        {
            for(int y = 0; y < CUBE_SIZE; y++)
            {
                for(int z = 0; z < CUBE_SIZE; z++)
                {
                    bool isXEdge = x == 0 || x == CUBE_SIZE - 1;
                    bool isYEdge = y == 0 || y == CUBE_SIZE - 1;
                    bool isZEdge = z == 0 || z == CUBE_SIZE - 1;

                    int edgeSum = CountTrue(isXEdge, isYEdge, isZEdge);

                    switch (edgeSum)
                    {
                    case 0:
                        m_cube[x,y,z] = new EmptyPiece(x + CUBE_OFFSET, y + CUBE_OFFSET, z + CUBE_OFFSET);
                        break;
                    case 1:
                        m_cube[x,y,z] = new CenterPiece(x + CUBE_OFFSET, y + CUBE_OFFSET, z + CUBE_OFFSET);
                        break;
                    case 2:
                        m_cube[x,y,z] = new EdgePiece(x + CUBE_OFFSET, y + CUBE_OFFSET, z + CUBE_OFFSET);
                        break;
                    case 3:
                        m_cube[x,y,z] = new CornerPiece(x + CUBE_OFFSET, y + CUBE_OFFSET, z + CUBE_OFFSET);
                        break;
                    }
                }
            }
        }
    }
Example #3
0
        private string GetCenterColor(CenterPiece piece)
        {
            if (Properties.Stage.ToLower() == "oll")
            {
                if (piece.ToString() == FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "coll")
            {
                if (piece.ToString() == FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "ocll")
            {
                if (piece.ToString() == FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "ell")
            {
                if (piece.ToString() == FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "f2l")
            {
                if (piece.ToString() != FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "ll")
            {
                if (piece.ToString() == FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "fl")
            {
                if (piece.ToString() == FaceType.D.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "cll")
            {
                if (piece.ToString() == FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "oell")
            {
                if (piece.ToString() == FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "ocell")
            {
                if (piece.ToString() == FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "cmll")
            {
                if (piece.ToString() == FaceType.R.ToString() || piece.ToString() == FaceType.L.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "cross")
            {
                if (piece.ToString() != FaceType.U.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "f2b")
            {
                if (piece.ToString() == FaceType.R.ToString() || piece.ToString() == FaceType.L.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }
            else if (Properties.Stage.ToLower() == "line")
            {
                if (piece.ToString() == FaceType.F.ToString() || piece.ToString() == FaceType.B.ToString())
                {
                    return(Properties.ColorScheme.GetSticker((int)piece));
                }
                else
                {
                    return(Properties.ColorScheme.GetSticker(null));
                }
            }

            return(Properties.ColorScheme.GetSticker((int)piece));
        }