Example #1
0
        public void MirrorPart(DollPartType srcPartType)
        {
            if (!DollPartTypes.IsMirrorable(srcPartType))
            {
                return;
            }

            var destPartType = DollPartTypes.Mirror(srcPartType);
            var srcPart      = ActiveParts[srcPartType];
            var destPath     = srcPart != null
                ? ActiveParts[srcPartType].MirrorPartPath()
                : null;

            SetPart(destPartType, destPath);

            foreach (DollColorType colorType in DollColorTypes.Values)
            {
                SetColor(destPartType, colorType, GetColor(srcPartType, colorType));
            }

            foreach (DollRangeType rangeType in DollRangeTypes.Values)
            {
                SetRangeFloat(destPartType, rangeType, GetRangeFloat(srcPartType, rangeType));
            }
        }
Example #2
0
        public string MirrorPartPath()
        {
            if (!DollPartTypes.IsMirrorable(Type))
            {
                return(Path);
            }

            switch (Type)
            {
            case DollPartType.ArmUpperRight:
                return(Path.Replace("04_Arm_Upper_Right", "05_Arm_Upper_Left")
                       .Replace("ArmUpperRight", "ArmUpperLeft"));

            case DollPartType.ArmUpperLeft:
                return(Path.Replace("05_Arm_Upper_Left", "04_Arm_Upper_Right")
                       .Replace("ArmUpperLeft", "ArmUpperRight"));

            case DollPartType.ArmLowerRight:
                return(Path.Replace("06_Arm_Lower_Right", "07_Arm_Lower_Left")
                       .Replace("ArmLowerRight", "ArmLowerLeft"));

            case DollPartType.ArmLowerLeft:
                return(Path.Replace("07_Arm_Lower_Left", "06_Arm_Lower_Right")
                       .Replace("ArmLowerLeft", "ArmLowerRight"));

            case DollPartType.HandRight:
                return(Path.Replace("08_Hand_Right", "09_Hand_Left")
                       .Replace("HandRight", "HandLeft"));

            case DollPartType.HandLeft:
                return(Path.Replace("09_Hand_Left", "08_Hand_Right")
                       .Replace("HandLeft", "HandRight"));

            case DollPartType.LegRight:
                return(Path.Replace("11_Leg_Right", "12_Leg_Left")
                       .Replace("LegRight", "LegLeft"));

            case DollPartType.LegLeft:
                return(Path.Replace("12_Leg_Left", "11_Leg_Right")
                       .Replace("LegLeft", "LegRight"));

            case DollPartType.ShoulderAttachmentRight:
                return(Path.Replace("05_Shoulder_Attachment_Right", "06_Shoulder_Attachment_Left")
                       .Replace("ShoulderAttachRight", "ShoulderAttachLeft"));

            case DollPartType.ShoulderAttachmentLeft:
                return(Path.Replace("06_Shoulder_Attachment_Left", "05_Shoulder_Attachment_Right")
                       .Replace("ShoulderAttachLeft", "ShoulderAttachRight"));

            case DollPartType.ElbowAttachmentRight:
                return(Path.Replace("07_Elbow_Attachment_Right", "08_Elbow_Attachment_Left")
                       .Replace("ElbowAttachRight", "ElbowAttachLeft"));

            case DollPartType.ElbowAttachmentLeft:
                return(Path.Replace("08_Elbow_Attachment_Left", "07_Elbow_Attachment_Right")
                       .Replace("ElbowAttachLeft", "ElbowAttachRight"));

            case DollPartType.KneeAttachmentRight:
                return(Path.Replace("10_Knee_Attachement_Right", "11_Knee_Attachement_Left")     // sic "Attachement"
                       .Replace("KneeAttachRight", "KneeAttachLeft"));

            case DollPartType.KneeAttachmentLeft:
                return(Path.Replace("11_Knee_Attachement_Left", "10_Knee_Attachement_Right")     // sic "Attachement"
                       .Replace("KneeAttachLeft", "KneeAttachRight"));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }