Example #1
0
        private static Integer2 SimpleTransform(int x, int y, BuildingOrientation orientation, int width, int height)
        {
            int sampleX = x;
            int sampleY = y;

            if (orientation.HasFlag(BuildingOrientation.Rotate90))
            {
                int temp = sampleY;
                sampleY = height - sampleX - 1;
                sampleX = temp;

                if (orientation.HasFlag(BuildingOrientation.MirrorX))
                {
                    sampleY = height - sampleY - 1;
                }
                if (orientation.HasFlag(BuildingOrientation.MirrorY))
                {
                    sampleX = width - sampleX - 1;
                }
            }
            else
            {
                if (orientation.HasFlag(BuildingOrientation.MirrorX))
                {
                    sampleX = width - sampleX - 1;
                }
                if (orientation.HasFlag(BuildingOrientation.MirrorY))
                {
                    sampleY = height - sampleY - 1;
                }
            }

            return(new Integer2(sampleX, sampleY));
        }
Example #2
0
 public RotatedBuilding(BuildingTemplate template, BuildingOrientation orientation)
 {
     Template    = template;
     Orientation = orientation;
 }
Example #3
0
 public OffsetAndRotation(Integer2 offset, BuildingOrientation orientation)
 {
     Offset      = offset;
     Orientation = orientation;
 }