コード例 #1
0
 public CubieTransform(string op, bool isReversedBasicOp, BasicOp basicOp, Func <string, Cubicle> getCubicle)
 {
     Op = op;
     IsReversedBasicOp = isReversedBasicOp;
     BasicOp           = basicOp;
     _getCubicle       = getCubicle;
 }
コード例 #2
0
        public static BasicOp GetBasicOp(string cubicleName, Axis axis)
        {
            IEnumerable <BasicOp> ops = _basicOps.Values.Where(op => op.Axis == axis);
            BasicOp basicOp           = ops.FirstOrDefault(op => cubicleName.Contains(op.Op));

            if (basicOp == null)
            {
                basicOp = ops.FirstOrDefault(op => op.Op.Contains("M"));
            }
            return(basicOp);
        }
コード例 #3
0
        public static void GetBasicOp(string op, out BasicOp basicOp, out bool isReverse)
        {
            basicOp = null;
            if (_equivalentOp.ContainsKey(op))
            {
                op = _equivalentOp[op];
            }
            isReverse = IsReverse(op);// (op.Substring(op.Length - 1) == "'");
            string basicOpKey = isReverse ? op.Substring(0, op.Length - 1) : op;

            basicOp = _basicOps[basicOpKey];
        }