Beispiel #1
0
        private void UpdateCategoryList()
        {
            string catsAdded   = "";
            string c           = "";
            var    placeholder = "";

            for (int ix = categoryList.Categories.Count - 1; ix > -1; ix--)
            {
                c           = categoryList.GetItem(ix);
                placeholder = ExtentFlag.GetPlaceHolder("categoryAdded" + c);

                if (extentSource.IndexOf(placeholder) == -1 && catsAdded.IndexOf(placeholder) == -1)
                {
                    catsAdded += ExtentFlag.GetPlaceHolder("categoryAdded" + c);
                }
                else
                {
                    categoryList.Categories.RemoveAt(ix);
                }
            }

            string source = CategoryOptionBuilder.Build(categoryList.Categories);

            if (source != "")
            {
                lock (sourcelock)
                {
                    extentSource = SourceBuilder.Build(extentSource,
                                                       new string[] { ExtentFlag.GetPlaceHolder("categoryListOptions"), ExtentFlag.GetPlaceHolder("categoryAdded") },
                                                       new string[] { source + ExtentFlag.GetPlaceHolder("categoryListOptions"), catsAdded + ExtentFlag.GetPlaceHolder("categoryAdded") });
                }
            }
        }
        public void GenerateStats(StringList lines)
        {
            int num = fEnemies.Count;

            if (num == 0)
            {
                return;
            }

            lines.Add("");
            lines.AddObject("    " + BaseLocale.GetStr(RS.rs_Killed), new JournalItem(JournalItem.SIT_KILLED, "", Colors.Red, JournalItem.DEFAULT_TURN));

            for (int i = 0; i < num; i++)
            {
                Core.Attribute attr = fEnemies.GetItem(i);
                int            id   = attr.AID;
                int            val  = attr.AValue;

                CreatureEntry ce = (CreatureEntry)GlobalVars.nwrDB.GetEntry(id);
                lines.Add("  " + ce.GetNounDeclension(Number.nSingle, Case.cNominative) + ": " + Convert.ToString(val));
            }
        }