Пример #1
0
        /// <summary>
        /// treats the cube as if it were rotated so that the relativeEdgePosition is bottom
        /// and then returns the side that is given by relativeSidePosition
        /// </summary>
        /// <param name="startSide"></param>
        /// <param name="relativeSidePosition"></param>
        /// <param name="relativeEdgePosition"></param>
        /// <returns></returns>
        public static Side GetRotationNeutralRelativeSide(Side startSide,
                                                          RelativeSidePosition relativeSidePosition, RelativeEdgePosition relativeEdgePosition)
        {
            if (relativeEdgePosition == RelativeEdgePosition.Left)
            {
                if (relativeSidePosition == RelativeSidePosition.Left)
                {
                    return(startSide.Top);
                }
                if (relativeSidePosition == RelativeSidePosition.Right)
                {
                    return(startSide.Bottom);
                }
                if (relativeSidePosition == RelativeSidePosition.Bottom)
                {
                    return(startSide.Left);
                }
                if (relativeSidePosition == RelativeSidePosition.Top)
                {
                    return(startSide.Right);
                }
                if (relativeSidePosition == RelativeSidePosition.Opposite)
                {
                    return(startSide.Opposite);
                }
                if (relativeSidePosition == RelativeSidePosition.Self)
                {
                    return(startSide);
                }
            }
            if (relativeEdgePosition == RelativeEdgePosition.Right)
            {
                if (relativeSidePosition == RelativeSidePosition.Left)
                {
                    return(startSide.Bottom);
                }
                if (relativeSidePosition == RelativeSidePosition.Right)
                {
                    return(startSide.Top);
                }
                if (relativeSidePosition == RelativeSidePosition.Bottom)
                {
                    return(startSide.Right);
                }
                if (relativeSidePosition == RelativeSidePosition.Top)
                {
                    return(startSide.Left);
                }
                if (relativeSidePosition == RelativeSidePosition.Opposite)
                {
                    return(startSide.Opposite);
                }
                if (relativeSidePosition == RelativeSidePosition.Self)
                {
                    return(startSide);
                }
            }
            if (relativeEdgePosition == RelativeEdgePosition.Top)
            {
                if (relativeSidePosition == RelativeSidePosition.Left)
                {
                    return(startSide.Right);
                }
                if (relativeSidePosition == RelativeSidePosition.Right)
                {
                    return(startSide.Left);
                }
                if (relativeSidePosition == RelativeSidePosition.Bottom)
                {
                    return(startSide.Top);
                }
                if (relativeSidePosition == RelativeSidePosition.Top)
                {
                    return(startSide.Bottom);
                }
                if (relativeSidePosition == RelativeSidePosition.Opposite)
                {
                    return(startSide.Opposite);
                }
                if (relativeSidePosition == RelativeSidePosition.Self)
                {
                    return(startSide);
                }
            }
            if (relativeEdgePosition == RelativeEdgePosition.Bottom)
            {
                if (relativeSidePosition == RelativeSidePosition.Left)
                {
                    return(startSide.Left);
                }
                if (relativeSidePosition == RelativeSidePosition.Right)
                {
                    return(startSide.Right);
                }
                if (relativeSidePosition == RelativeSidePosition.Bottom)
                {
                    return(startSide.Bottom);
                }
                if (relativeSidePosition == RelativeSidePosition.Top)
                {
                    return(startSide.Top);
                }
                if (relativeSidePosition == RelativeSidePosition.Opposite)
                {
                    return(startSide.Opposite);
                }
                if (relativeSidePosition == RelativeSidePosition.Self)
                {
                    return(startSide);
                }
            }

            return(null);
        }
Пример #2
0
 /// <summary>
 /// treats the cube as if it were rotated so that the relativeEdgePosition is bottom
 /// and then returns the side relation of the start side and the relative side
 /// </summary>
 /// <param name="startSide"></param>
 /// <param name="relativeSidePosition"></param>
 /// <param name="relativeEdgePosition"></param>
 /// <returns></returns>
 public static RelativeSidePosition GetRotationNeutralRelativeSidePosition(Side startSide,
                                                                           RelativeSidePosition relativeSidePosition, RelativeEdgePosition relativeEdgePosition)
 {
     return(GetSideRelation(startSide.CubeSide, GetRotationNeutralRelativeSide(startSide, relativeSidePosition, relativeEdgePosition).CubeSide));
 }