void SetDefs(SkewbImageConfiguration config) { var defs = ""; foreach (string face in Center.PieceNames) { var CornerIndices = Corner.GetStickerOrder(char.Parse(face)); foreach (var cornerIndex in CornerIndices) { var Faces = Corner.PieceNames[cornerIndex]; for (int i = 0; i < Faces.Length; i++) { if (char.Parse(face) == Faces[i]) { defs += GetColorFromFace(Corners[cornerIndex].GetFace(i)); } } } for (int i = 0; i < Center.PieceNames.Length; i++) { if (face == Center.PieceNames[i]) { defs += GetColorFromFace(char.Parse(Centers[i].PieceName)); } } } config.StickerDefs = defs; }
public SkewbImageProp(SkewbImageConfiguration configs) : base(configs) { DFace = configs.Dface; ShortFaceDist = (ImageLength / 8) / Math.Cos(Math.PI * 30 / 180); LongFaceDist = ShortFaceDist * 2; var yAboveCenter = (ImageLength / 8) * Math.Tan(Math.PI * 30 / 180) * 6; var yBelowCenter = LongFaceDist * (DFace ? 2 : 1); ImageSize = new Tuple <double, double>(ImageLength, yAboveCenter + yBelowCenter); Center = new CoordPair(ImageLength / 2, yAboveCenter); AddColorScheme(configs.ColorScheme); }
public VirtualSkewb(SkewbImageConfiguration configs) { CleanSkewb(); DefineMoves(); if (configs.Moves != null) { PreformAlg(configs.Moves); } else if (configs.Case != null) { PreformAlg(configs.Case, reverse: true); } if (configs.StickerDefs == null) { SetDefs(configs); } }
private void CreateFacees(SkewbImageConfiguration configs) { var stickerColors = ParseDefs(configs.StickerDefs); if (stickerColors.Length == 6 || (Properties.DFace && stickerColors.Length == 5)) { var tempFaces = new List <Face>(); for (int i = 0; i < 3; i++) { var angle = Math.PI * 120 / 180 * i; tempFaces.Add(new Face(stickerColors[i], angle, Properties.Center, Properties)); if (i != 0 || Properties.DFace) { tempFaces.Add(new Face(stickerColors[i + 3], (i == 0 ? 0 : Math.PI * 240 / 180) , CoordPair.CartesianFromPolar(Properties.LongFaceDist, angle, Properties.Center), Properties)); } } Faces = tempFaces.ToArray(); } }
public SkewbImage(SkewbImageConfiguration configs) { Properties = new SkewbImageProp(configs); CreateFacees(configs); }