コード例 #1
0
 private void SetDisplayGender( )
 {
     //activate the appropriate gender radio button.
     if (currentKerbal.GetStat("gender").ToLower( ) == "female")
     {
         rd_female.Checked = true;
     }
     else
     {
         rd_male.Checked = true;
     }
 }
コード例 #2
0
        internal void UpdateKerbalStats(Kerbal currentKerbal)
        {
            lbl_ki_genderdisp.Text = currentKerbal.GetStat("gender");
            lbl_ki_roledisp.Text   = currentKerbal.GetStat("trait");
            lbl_ki_statusdisp.Text = currentKerbal.GetStat("type");
            lbl_ki_badsdisp.Text   = currentKerbal.GetStat("badS");
            lbl_ki_tourdisp.Text   = currentKerbal.GetStat("tour");
            lbl_ki_bravedisp.Text  = currentKerbal.GetStat("brave");
            lbl_ki_stupiddisp.Text = currentKerbal.GetStat("dumb");
            lbl_ki_statedisp.Text  = currentKerbal.GetStat("state");

            foreach (KeyValuePair <string, string> stat in currentKerbal.Stats)
            {
                if (stat.Key == "gender")
                {
                    lbl_ki_genderdisp.Text = stat.Value;
                }
                if (stat.Key == "trait")
                {
                    lbl_ki_roledisp.Text = stat.Value;
                }
                if (stat.Key == "type")
                {
                    lbl_ki_statusdisp.Text = stat.Value;
                }
                if (stat.Key == "badS")
                {
                    lbl_ki_badsdisp.Text = stat.Value;
                }
                if (stat.Key == "tour")
                {
                    lbl_ki_tourdisp.Text = stat.Value;
                }
                if (stat.Key == "brave")
                {
                    lbl_ki_bravedisp.Text = stat.Value;
                }
                if (stat.Key == "dumb")
                {
                    lbl_ki_stupiddisp.Text = stat.Value;
                }
                if (stat.Key == "state")
                {
                    lbl_ki_statedisp.Text = stat.Value;
                }
            }
        }