Пример #1
0
        private SimTemplateCreateInfo CASToNeighGen(CASFamilyMember x)
        {
            var code = ((x.Gender & 1) == 0) ? "m" : "f";

            code += (x.Gender > 1) ? "c" : "a";
            var ind      = x.Body.IndexOf("_");
            var bodyType = x.Body.Substring(ind - 3, 3);

            code += bodyType;
            var info = new SimTemplateCreateInfo(code, x.SkinColor);

            info.Name = x.Name;
            info.Bio  = x.Bio;
            info.PersonalityPoints = x.Personality;

            info.BodyStringReplace[1] = x.Body + ",BODY=" + x.BodyTex;
            info.BodyStringReplace[2] = x.Head + ",HEAD-HEAD=" + x.HeadTex;

            var hand = (x.Gender > 1) ? "u" : ((x.Gender == 0) ? "m" : "f");

            info.BodyStringReplace[17] = "H" + hand + "LO,HAND=" + "huao" + x.HandgroupTex;
            info.BodyStringReplace[18] = "H" + hand + "RO,HAND=" + "huao" + x.HandgroupTex;
            info.BodyStringReplace[19] = "H" + hand + "LP,HAND=" + "huao" + x.HandgroupTex;
            info.BodyStringReplace[20] = "H" + hand + "RP,HAND=" + "huao" + x.HandgroupTex;
            info.BodyStringReplace[21] = "H" + hand + "LO,HAND=" + "huao" + x.HandgroupTex;
            info.BodyStringReplace[22] = "H" + hand + "RC,HAND=" + "huao" + x.HandgroupTex;
            return(info);
        }
Пример #2
0
        public CASFamilyMember BuildMember()
        {
            //build the object out of the contents of various menus
            var i   = (int)DirectionUtils.PosMod(Math.Round(BodyPosition + 8), ActiveBodies.Count);
            var j   = (int)DirectionUtils.PosMod(Math.Round(HeadPosition + 8), ActiveHeads.Count);
            var sim = new CASFamilyMember()
            {
                Name         = CASPanel.FirstNameTextBox.CurrentText,
                Bio          = CASPanel.BioEdit.CurrentText,
                Body         = ActiveBodies[i],
                BodyTex      = ActiveBodyTex[i],
                HandgroupTex = ActiveHandgroupTex[i],
                Head         = ActiveHeads[j],
                HeadTex      = ActiveHeadTex[j],
                Gender       = (short)(((CurrentCode[0] == 'm') ? 0 : 1) | ((CurrentCode[1] == 'c') ? 2 : 0)),
                Personality  = CASPanel.Personalities.Select(x => (short)(x.Points * 100)).ToArray(),
                SkinColor    = CurrentSkin
            };

            return(sim);
        }