Ejemplo n.º 1
0
        public PieceSouthWestModel(XyzCubeTypes patternCubeType) : base()
        {
            this.StickerSouth = new StickerSouthModel(this.GetSouthStickerColorType(patternCubeType));
            this.StickerWest  = new StickerWestModel(this.GetWestStickerColorType(patternCubeType));

            this.Stickers.Add(this.StickerSouth);
            this.Stickers.Add(this.StickerWest);
        }
Ejemplo n.º 2
0
        public PieceFrontNorthModel(XyzCubeTypes patternCubeType) : base()
        {
            this.StickerFront = new StickerFrontModel(this.GetFrontStickerColorType(patternCubeType));
            this.StickerNorth = new StickerNorthModel(this.GetNorthStickerColorType(patternCubeType));

            this.Stickers.Add(this.StickerFront);
            this.Stickers.Add(this.StickerNorth);
        }
Ejemplo n.º 3
0
        public PieceBackEastModel(XyzCubeTypes patternCubeType) : base()
        {
            this.StickerBack = new StickerBackModel(this.GetBackStickerColorType(patternCubeType));
            this.StickerEast = new StickerEastModel(this.GetEastStickerColorType(patternCubeType));

            this.Stickers.Add(this.StickerBack);
            this.Stickers.Add(this.StickerEast);
        }
Ejemplo n.º 4
0
        public PieceBackNorthModel(XyzCubeTypes patternCubeType) : base()
        {
            this.StickerBack  = new StickerBackModel(this.GetBackStickerColorType(patternCubeType));
            this.StickerNorth = new StickerNorthModel(this.GetNorthStickerColorType(patternCubeType));

            this.Stickers.Add(this.StickerBack);
            this.Stickers.Add(this.StickerNorth);
        }
Ejemplo n.º 5
0
        public PieceNorthEastModel(XyzCubeTypes patternCubeType) : base()
        {
            this.StickerNorth = new StickerNorthModel(this.GetNorthStickerColorType(patternCubeType));
            this.StickerEast  = new StickerEastModel(this.GetEastStickerColorType(patternCubeType));

            this.Stickers.Add(this.StickerNorth);
            this.Stickers.Add(this.StickerEast);
        }
Ejemplo n.º 6
0
        public PieceFrontEastModel(XyzCubeTypes patternCubeType) : base()
        {
            this.StickerFront = new StickerFrontModel(this.GetFrontStickerColorType(patternCubeType));
            this.StickerEast  = new StickerEastModel(this.GetEastStickerColorType(patternCubeType));

            this.Stickers.Add(this.StickerFront);
            this.Stickers.Add(this.StickerEast);
        }
Ejemplo n.º 7
0
        public override PieceMiddleModelBase CopyPiece(XyzCubeTypes patternCubeType)
        {
            var copy = new PieceEastModel(patternCubeType);

            return(copy);
        }
Ejemplo n.º 8
0
        public CubeModel Create(XyzCubeTypes patternCubeType, String[] sides)
        {
            var cubePeiceBag = new CubePeiceBagModel(patternCubeType);

            var result = new CubeModel(cubePeiceBag);

            List <StickerIndexModel> GetCorners(Char[] rawStickers, StickerColorTypes stickerColorType)
            {
                return(new List <StickerIndexModel>()
                {
                    new StickerIndexModel(this.GetStickerColorType(rawStickers[0]), 0, stickerColorType),
                    new StickerIndexModel(this.GetStickerColorType(rawStickers[2]), 2, stickerColorType),
                    new StickerIndexModel(this.GetStickerColorType(rawStickers[6]), 6, stickerColorType),
                    new StickerIndexModel(this.GetStickerColorType(rawStickers[8]), 8, stickerColorType)
                });
            }

            List <StickerIndexModel> GetSides(Char[] rawStickers, StickerColorTypes stickerColorType)
            {
                return(new List <StickerIndexModel>()
                {
                    new StickerIndexModel(this.GetStickerColorType(rawStickers[1]), 1, stickerColorType),
                    new StickerIndexModel(this.GetStickerColorType(rawStickers[3]), 3, stickerColorType),
                    new StickerIndexModel(this.GetStickerColorType(rawStickers[5]), 5, stickerColorType),
                    new StickerIndexModel(this.GetStickerColorType(rawStickers[7]), 7, stickerColorType)
                });
            }

            String whiteCommand  = String.Empty;
            String yellowCommand = String.Empty;
            String blueCommand   = String.Empty;
            String greenCommand  = String.Empty;
            String redCommand    = String.Empty;
            String orangeCommand = String.Empty;

            {
                foreach (var side in sides)
                {
                    switch (side[4])
                    {
                    case 'W':
                        whiteCommand = side;
                        break;

                    case 'Y':
                        yellowCommand = side;
                        break;

                    case 'B':
                        blueCommand = side;
                        break;

                    case 'G':
                        greenCommand = side;
                        break;

                    case 'R':
                        redCommand = side;
                        break;

                    case 'O':
                        orangeCommand = side;
                        break;

                    default:
                        break;
                    }
                }
            }

            this.VerifyRawCube(whiteCommand, yellowCommand, blueCommand, greenCommand, redCommand, orangeCommand);

            Char[] whiteStep  = whiteCommand.ToCharArray();
            Char[] yellowStep = yellowCommand.ToCharArray();
            Char[] blueStep   = blueCommand.ToCharArray();
            Char[] greenStep  = greenCommand.ToCharArray();
            Char[] redStep    = redCommand.ToCharArray();
            Char[] orangeStep = orangeCommand.ToCharArray();

            var allStickers = new List <StickerIndexModel>();

            allStickers.AddRange(GetCorners(whiteStep, StickerColorTypes.White));
            allStickers.AddRange(GetCorners(yellowStep, StickerColorTypes.Yellow));
            allStickers.AddRange(GetCorners(blueStep, StickerColorTypes.Blue));
            allStickers.AddRange(GetCorners(greenStep, StickerColorTypes.Green));
            allStickers.AddRange(GetCorners(redStep, StickerColorTypes.Red));
            allStickers.AddRange(GetCorners(orangeStep, StickerColorTypes.Orange));

            allStickers.AddRange(GetSides(whiteStep, StickerColorTypes.White));
            allStickers.AddRange(GetSides(yellowStep, StickerColorTypes.Yellow));
            allStickers.AddRange(GetSides(blueStep, StickerColorTypes.Blue));
            allStickers.AddRange(GetSides(greenStep, StickerColorTypes.Green));
            allStickers.AddRange(GetSides(redStep, StickerColorTypes.Red));
            allStickers.AddRange(GetSides(orangeStep, StickerColorTypes.Orange));

            SlotSideModelBase pieceFrontNorthModel = this.FindSideSlot(result, allStickers);

            return(null);
        }
Ejemplo n.º 9
0
        public override PieceSideModelBase CopyPiece(XyzCubeTypes patternCubeType)
        {
            var copy = new PieceSouthWestModel(patternCubeType);

            return(copy);
        }
        public override PieceCornerModelBase CopyPiece(XyzCubeTypes patternCubeType)
        {
            var copy = new PieceFrontNorthWestModel(patternCubeType);

            return(copy);
        }
Ejemplo n.º 11
0
 public abstract PieceCornerModelBase CopyPiece(XyzCubeTypes patternCubeType);
Ejemplo n.º 12
0
        public StickerColorTypes GetBackStickerColorType(XyzCubeTypes patternCubeType)
        {
            StickerColorTypes result;

            if (patternCubeType == XyzCubeTypes.BlueOrangeWhite)
            {
                result = StickerColorTypes.Yellow;
            }
            else if (patternCubeType == XyzCubeTypes.BlueRedYellow)
            {
                result = StickerColorTypes.White;
            }
            else if (patternCubeType == XyzCubeTypes.BlueWhiteRed)
            {
                result = StickerColorTypes.Orange;
            }
            else if (patternCubeType == XyzCubeTypes.BlueYellowOrange)
            {
                result = StickerColorTypes.Red;
            }
            else if (patternCubeType == XyzCubeTypes.GreenOrangeYellow)
            {
                result = StickerColorTypes.White;
            }
            else if (patternCubeType == XyzCubeTypes.GreenRedWhite)
            {
                result = StickerColorTypes.Yellow;
            }
            else if (patternCubeType == XyzCubeTypes.GreenWhiteOrange)
            {
                result = StickerColorTypes.Red;
            }
            else if (patternCubeType == XyzCubeTypes.GreenYellowRed)
            {
                result = StickerColorTypes.Orange;
            }
            else if (patternCubeType == XyzCubeTypes.OrangeBlueYellow)
            {
                result = StickerColorTypes.White;
            }
            else if (patternCubeType == XyzCubeTypes.OrangeGreenWhite)
            {
                result = StickerColorTypes.Yellow;
            }
            else if (patternCubeType == XyzCubeTypes.OrangeWhiteBlue)
            {
                result = StickerColorTypes.Green;
            }
            else if (patternCubeType == XyzCubeTypes.OrangeYellowGreen)
            {
                result = StickerColorTypes.Blue;
            }
            else if (patternCubeType == XyzCubeTypes.RedBlueWhite)
            {
                result = StickerColorTypes.Yellow;
            }
            else if (patternCubeType == XyzCubeTypes.RedGreenYellow)
            {
                result = StickerColorTypes.White;
            }
            else if (patternCubeType == XyzCubeTypes.RedWhiteGreen)
            {
                result = StickerColorTypes.Blue;
            }
            else if (patternCubeType == XyzCubeTypes.RedYellowBlue)
            {
                result = StickerColorTypes.Green;
            }
            else if (patternCubeType == XyzCubeTypes.WhiteBlueOrange)
            {
                result = StickerColorTypes.Red;
            }
            else if (patternCubeType == XyzCubeTypes.WhiteGreenRed)
            {
                result = StickerColorTypes.Orange;
            }
            else if (patternCubeType == XyzCubeTypes.WhiteOrangeGreen)
            {
                result = StickerColorTypes.Blue;
            }
            else if (patternCubeType == XyzCubeTypes.WhiteRedBlue)
            {
                result = StickerColorTypes.Green;
            }
            else if (patternCubeType == XyzCubeTypes.YellowBlueRed)
            {
                result = StickerColorTypes.Orange;
            }
            else if (patternCubeType == XyzCubeTypes.YellowGreenOrange)
            {
                result = StickerColorTypes.Red;
            }
            else if (patternCubeType == XyzCubeTypes.YellowOrangeBlue)
            {
                result = StickerColorTypes.Green;
            }
            else if (patternCubeType == XyzCubeTypes.YellowRedGreen)
            {
                result = StickerColorTypes.Blue;
            }
            else
            {
                throw new Exception($"GetNorthStickerColorType {patternCubeType} not fount");
            }

            return(result);
        }
Ejemplo n.º 13
0
 public String GetStickerAbbreviation(XyzCubeTypes xyzCubeTypes, StickerColorTypes stickerColorType)
 {
     if (stickerColorType == StickerColorTypes.White || stickerColorType == StickerColorTypes.Yellow)
     {
         if (xyzCubeTypes == XyzCubeTypes.WhiteBlueOrange ||
             xyzCubeTypes == XyzCubeTypes.WhiteGreenRed ||
             xyzCubeTypes == XyzCubeTypes.WhiteOrangeGreen ||
             xyzCubeTypes == XyzCubeTypes.WhiteRedBlue)
         {
             return((stickerColorType == StickerColorTypes.White) ? "A" : "X");
         }
         else if (xyzCubeTypes == XyzCubeTypes.BlueWhiteRed ||
                  xyzCubeTypes == XyzCubeTypes.GreenWhiteOrange ||
                  xyzCubeTypes == XyzCubeTypes.OrangeWhiteBlue ||
                  xyzCubeTypes == XyzCubeTypes.RedWhiteGreen
                  )
         {
             return((stickerColorType == StickerColorTypes.White) ? "B" : "Y");
         }
         else if (xyzCubeTypes == XyzCubeTypes.BlueOrangeWhite ||
                  xyzCubeTypes == XyzCubeTypes.GreenRedWhite ||
                  xyzCubeTypes == XyzCubeTypes.OrangeGreenWhite ||
                  xyzCubeTypes == XyzCubeTypes.RedBlueWhite)
         {
             return((stickerColorType == StickerColorTypes.White) ? "C" : "Z");
         }
         else if (xyzCubeTypes == XyzCubeTypes.YellowOrangeBlue ||
                  xyzCubeTypes == XyzCubeTypes.YellowRedGreen ||
                  xyzCubeTypes == XyzCubeTypes.YellowGreenOrange ||
                  xyzCubeTypes == XyzCubeTypes.YellowBlueRed)
         {
             return((stickerColorType == StickerColorTypes.White) ? "X" : "A");
         }
         else if (xyzCubeTypes == XyzCubeTypes.RedYellowBlue ||
                  xyzCubeTypes == XyzCubeTypes.OrangeYellowGreen ||
                  xyzCubeTypes == XyzCubeTypes.BlueYellowOrange ||
                  xyzCubeTypes == XyzCubeTypes.GreenYellowRed
                  )
         {
             return((stickerColorType == StickerColorTypes.White) ? "Y" : "B");
         }
         else if (xyzCubeTypes == XyzCubeTypes.OrangeBlueYellow ||
                  xyzCubeTypes == XyzCubeTypes.RedGreenYellow ||
                  xyzCubeTypes == XyzCubeTypes.GreenOrangeYellow ||
                  xyzCubeTypes == XyzCubeTypes.BlueRedYellow)
         {
             return((stickerColorType == StickerColorTypes.White) ? "Z" : "C");
         }
     }
     else if (stickerColorType == StickerColorTypes.Blue || stickerColorType == StickerColorTypes.Green)
     {
         if (xyzCubeTypes == XyzCubeTypes.BlueOrangeWhite ||
             xyzCubeTypes == XyzCubeTypes.BlueRedYellow ||
             xyzCubeTypes == XyzCubeTypes.BlueWhiteRed ||
             xyzCubeTypes == XyzCubeTypes.BlueYellowOrange)
         {
             return((stickerColorType == StickerColorTypes.Blue) ? "A" : "X");
         }
         else if (xyzCubeTypes == XyzCubeTypes.OrangeBlueYellow ||
                  xyzCubeTypes == XyzCubeTypes.RedBlueWhite ||
                  xyzCubeTypes == XyzCubeTypes.WhiteBlueOrange ||
                  xyzCubeTypes == XyzCubeTypes.YellowBlueRed
                  )
         {
             return((stickerColorType == StickerColorTypes.Blue) ? "B" : "Y");
         }
         else if (xyzCubeTypes == XyzCubeTypes.OrangeWhiteBlue ||
                  xyzCubeTypes == XyzCubeTypes.RedYellowBlue ||
                  xyzCubeTypes == XyzCubeTypes.WhiteRedBlue ||
                  xyzCubeTypes == XyzCubeTypes.YellowOrangeBlue)
         {
             return((stickerColorType == StickerColorTypes.Blue) ? "C" : "Z");
         }
         else if (xyzCubeTypes == XyzCubeTypes.GreenWhiteOrange ||
                  xyzCubeTypes == XyzCubeTypes.GreenYellowRed ||
                  xyzCubeTypes == XyzCubeTypes.GreenRedWhite ||
                  xyzCubeTypes == XyzCubeTypes.GreenOrangeYellow)
         {
             return((stickerColorType == StickerColorTypes.Blue) ? "X" : "A");
         }
         else if (xyzCubeTypes == XyzCubeTypes.OrangeGreenWhite ||
                  xyzCubeTypes == XyzCubeTypes.RedGreenYellow ||
                  xyzCubeTypes == XyzCubeTypes.WhiteGreenRed ||
                  xyzCubeTypes == XyzCubeTypes.YellowGreenOrange
                  )
         {
             return((stickerColorType == StickerColorTypes.Blue) ? "Y" : "B");
         }
         else if (xyzCubeTypes == XyzCubeTypes.OrangeYellowGreen ||
                  xyzCubeTypes == XyzCubeTypes.RedWhiteGreen ||
                  xyzCubeTypes == XyzCubeTypes.WhiteOrangeGreen ||
                  xyzCubeTypes == XyzCubeTypes.YellowRedGreen)
         {
             return((stickerColorType == StickerColorTypes.Blue) ? "Z" : "C");
         }
     }
     else if (stickerColorType == StickerColorTypes.Red || stickerColorType == StickerColorTypes.Orange)
     {
         if (xyzCubeTypes == XyzCubeTypes.RedYellowBlue ||
             xyzCubeTypes == XyzCubeTypes.RedWhiteGreen ||
             xyzCubeTypes == XyzCubeTypes.RedBlueWhite ||
             xyzCubeTypes == XyzCubeTypes.RedGreenYellow)
         {
             return((stickerColorType == StickerColorTypes.Red) ? "A" : "X");
         }
         else if (xyzCubeTypes == XyzCubeTypes.BlueRedYellow ||
                  xyzCubeTypes == XyzCubeTypes.GreenRedWhite ||
                  xyzCubeTypes == XyzCubeTypes.WhiteRedBlue ||
                  xyzCubeTypes == XyzCubeTypes.YellowRedGreen)
         {
             return((stickerColorType == StickerColorTypes.Red) ? "B" : "Y");
         }
         else if (xyzCubeTypes == XyzCubeTypes.BlueWhiteRed ||
                  xyzCubeTypes == XyzCubeTypes.GreenYellowRed ||
                  xyzCubeTypes == XyzCubeTypes.WhiteGreenRed ||
                  xyzCubeTypes == XyzCubeTypes.YellowBlueRed)
         {
             return((stickerColorType == StickerColorTypes.Red) ? "C" : "Z");
         }
         else if (xyzCubeTypes == XyzCubeTypes.OrangeBlueYellow ||
                  xyzCubeTypes == XyzCubeTypes.OrangeGreenWhite ||
                  xyzCubeTypes == XyzCubeTypes.OrangeWhiteBlue ||
                  xyzCubeTypes == XyzCubeTypes.OrangeYellowGreen)
         {
             return((stickerColorType == StickerColorTypes.Red) ? "X" : "A");
         }
         else if (xyzCubeTypes == XyzCubeTypes.BlueOrangeWhite ||
                  xyzCubeTypes == XyzCubeTypes.GreenOrangeYellow ||
                  xyzCubeTypes == XyzCubeTypes.WhiteOrangeGreen ||
                  xyzCubeTypes == XyzCubeTypes.YellowOrangeBlue
                  )
         {
             return((stickerColorType == StickerColorTypes.Red) ? "Y" : "B");
         }
         else if (xyzCubeTypes == XyzCubeTypes.BlueYellowOrange ||
                  xyzCubeTypes == XyzCubeTypes.GreenWhiteOrange ||
                  xyzCubeTypes == XyzCubeTypes.WhiteBlueOrange ||
                  xyzCubeTypes == XyzCubeTypes.YellowGreenOrange)
         {
             return((stickerColorType == StickerColorTypes.Red) ? "Z" : "C");
         }
     }
     throw new Exception("GetStickerAbbreviation Error");
 }
        public override PieceCornerModelBase CopyPiece(XyzCubeTypes patternCubeType)
        {
            var copy = new PieceBackSouthEastModel(patternCubeType);

            return(copy);
        }
Ejemplo n.º 15
0
 public abstract PieceMiddleModelBase CopyPiece(XyzCubeTypes patternCubeType);
Ejemplo n.º 16
0
        public CubePeiceBagModel(XyzCubeTypes xyzCubeType)
        {
            this.FrontPiece = new PieceFrontModel(xyzCubeType);
            this.BackPiece  = new PieceBackModel(xyzCubeType);
            this.NorthPiece = new PieceNorthModel(xyzCubeType);
            this.SouthPiece = new PieceSouthModel(xyzCubeType);
            this.EastPiece  = new PieceEastModel(xyzCubeType);
            this.WestPiece  = new PieceWestModel(xyzCubeType);

            this.FrontNorthPiece = new PieceFrontNorthModel(xyzCubeType);
            this.FrontEastPiece  = new PieceFrontEastModel(xyzCubeType);
            this.FrontSouthPiece = new PieceFrontSouthModel(xyzCubeType);
            this.FrontWestPiece  = new PieceFrontWestModel(xyzCubeType);

            this.FrontNorthEastPiece = new PieceFrontNorthEastModel(xyzCubeType);
            this.FrontSouthEastPiece = new PieceFrontSouthEastModel(xyzCubeType);
            this.FrontSouthWestPiece = new PieceFrontSouthWestModel(xyzCubeType);
            this.FrontNorthWestPiece = new PieceFrontNorthWestModel(xyzCubeType);

            this.NorthEastPiece = new PieceNorthEastModel(xyzCubeType);
            this.SouthEastPiece = new PieceSouthEastModel(xyzCubeType);
            this.SouthWestPiece = new PieceSouthWestModel(xyzCubeType);
            this.NorthWestPiece = new PieceNorthWestModel(xyzCubeType);

            this.BackNorthPiece = new PieceBackNorthModel(xyzCubeType);
            this.BackEastPiece  = new PieceBackEastModel(xyzCubeType);
            this.BackSouthPiece = new PieceBackSouthModel(xyzCubeType);
            this.BackWestPiece  = new PieceBackWestModel(xyzCubeType);

            this.BackNorthEastPiece = new PieceBackNorthEastModel(xyzCubeType);
            this.BackSouthEastPiece = new PieceBackSouthEastModel(xyzCubeType);
            this.BackSouthWestPiece = new PieceBackSouthWestModel(xyzCubeType);
            this.BackNorthWestPiece = new PieceBackNorthWestModel(xyzCubeType);

            this.Sides = new PieceSideModelBase[12];

            this.Sides[0] = this.FrontNorthPiece;
            this.Sides[1] = this.FrontEastPiece;
            this.Sides[2] = this.FrontSouthPiece;
            this.Sides[3] = this.FrontWestPiece;

            this.Sides[4] = this.NorthEastPiece;
            this.Sides[5] = this.SouthEastPiece;
            this.Sides[6] = this.SouthWestPiece;
            this.Sides[7] = this.NorthWestPiece;

            this.Sides[8]  = this.BackNorthPiece;
            this.Sides[9]  = this.BackEastPiece;
            this.Sides[10] = this.BackSouthPiece;
            this.Sides[11] = this.BackWestPiece;


            this.Corners = new PieceCornerModelBase[8];

            this.Corners[0] = this.FrontNorthEastPiece;
            this.Corners[1] = this.FrontSouthEastPiece;
            this.Corners[2] = this.FrontSouthWestPiece;
            this.Corners[3] = this.FrontNorthWestPiece;
            this.Corners[4] = this.BackNorthEastPiece;
            this.Corners[5] = this.BackSouthEastPiece;
            this.Corners[6] = this.BackSouthWestPiece;
            this.Corners[7] = this.BackNorthWestPiece;
        }