static TalentReader()
        {
            Assembly     assembly = Assembly.GetExecutingAssembly();
            StreamReader sr       = new StreamReader(assembly.GetManifestResourceStream("WFRP_NPC_Creator.Data.TalentData.txt"));

            string[] talentData = sr.ReadToEnd().Split('\n');
            string   max, name, tests;
            bool     relevance;

            for (int i = 0; i < talentData.Length; i++)
            {
                if (talentData[i].Length > 4 && talentData[i].Substring(0, 4) == "Max:")
                {
                    max       = talentData[i].Substring(5).Trim();
                    name      = talentData[i - 5].Trim();
                    relevance = talentData[i - 4].Trim() == "1";
                    if (talentData[i + 1].Length > 6 && talentData[i + 1].Substring(0, 6) == "Tests:")
                    {
                        tests = talentData[i + 1].Substring(7).Trim();
                    }
                    else
                    {
                        tests = "";
                    }
                    Talent.TalentList.Add(new TalentInfo(Talent.GenericName(name), max, tests, relevance));
                }
            }
            sr.Close();
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();

            CareerJsonReader.read = true;
            TalentReader.read     = true;

            this.DataContext = new WindowViewModel();

            foreach (Career career in Career.GetCareerList())
            {
                foreach (string talent in career.CareerTalents)
                {
                    if (Talent.TalentList.Find(t => t.Name == Talent.GenericName(talent)) == null)
                    {
                        System.Diagnostics.Debug.WriteLine(talent + " not found");
                    }
                }
            }
        }