コード例 #1
0
ファイル: TemTrait.cs プロジェクト: yyon/TemTacO
        public static TemTrait FromCsv(string csvLine, CultureInfo cultureInfo)
        {
            string[] values    = csvLine.Split(';');
            TemTrait temTraits = new TemTrait();

            temTraits.Name        = Convert.ToString(values[0], cultureInfo);
            temTraits.Description = Convert.ToString(values[1], cultureInfo);
            return(temTraits);
        }
コード例 #2
0
        private List <TemTrait> PopulateTraits()
        {
            log.Info("Reading TemTraits.csv");
            List <TemTrait> tempTemTraits = File.ReadAllLines("Resources\\TemTraits.csv")
                                            .Skip(1)
                                            .Select(v => TemTrait.FromCsv(v, enEn))
                                            .ToList();

            return(tempTemTraits);
        }
コード例 #3
0
 private void SetTrait(TemTem Tem)
 {
     string[] Traits = Tem.Trait.ToString().Split(':');
     if (Traits.Length > 0)
     {
         //Set Trait Name
         EnemyTemTraitName1.Content = Traits[0];
         //Set Trait Description
         int      index    = TemTraits.FindIndex(x => x.Name.Contains(Traits[0]));
         TemTrait TemTrait = TemTraits[index];
         EnemyTemTraitDescription1.Text = TemTrait.Description;
     }
     if (Traits.Length > 1)
     {
         //Set Trait Name
         EnemyTemTraitName2.Content = Traits[1];
         //Set Trait Description
         int      index    = TemTraits.FindIndex(x => x.Name.Contains(Traits[1]));
         TemTrait TemTrait = TemTraits[index];
         EnemyTemTraitDescription2.Text = TemTrait.Description;
     }
 }