コード例 #1
0
ファイル: Person.cs プロジェクト: RtHiaHB/PopSim2
        private string NewThoughts()
        {
            Gender    genpref;
            HairColor hairpref    = HairColor.Blonde;
            int       hairprefbon = -7;
            EyeColor  eyepref     = EyeColor.Blue;
            int       eyeprefbon  = -7;
            Size      sizepref    = PopSim2.Size.Small;
            int       sizeprefbon = -7;
            string    thought     = "";

            if (GetGender == Gender.Male)
            {
                genpref = Gender.Female;
            }
            else
            {
                genpref = Gender.Male;
            }
            for (int i = 0; i < (int)HairColor.Red; i++)
            {
                if (myPrefs.Hair((HairColor)i) > hairprefbon)
                {
                    hairpref    = (HairColor)i;
                    hairprefbon = myPrefs.Hair((HairColor)i);
                }
            }
            for (int i = 0; i < (int)EyeColor.Hazel; i++)
            {
                if (myPrefs.Eyes((EyeColor)i) > eyeprefbon)
                {
                    eyepref    = (EyeColor)i;
                    eyeprefbon = myPrefs.Eyes((EyeColor)i);
                }
            }
            for (int i = 0; i < (int)PopSim2.Size.Large; i++)
            {
                if (myPrefs.Size((PopSim2.Size)i) > sizeprefbon)
                {
                    sizeprefbon = myPrefs.Size((PopSim2.Size)i);
                    sizepref    = (PopSim2.Size)i;
                }
            }
            thought += "My Name is " + this.Name.ToString();
            thought += "\nI am a " + this.GetGender.ToString("F");
            thought += "\nI have " + this.Hair.ToString("F") + " hair, " +
                       this.Eyes.ToString("F") + " eyes, and I am " + this.Size.ToString("F");
            thought += "\nI like " + genpref.ToString("F") + "s with " + hairpref.ToString("F") +
                       " hair, " + eyepref.ToString("F") + " eyes and are " + sizepref.ToString("F");
            return(thought);
        }