Exemple #1
0
        private static void ProcessRaces(RdlTagCollection tags)
        {
            List <RdlRace> races = tags.GetTags <RdlRace>(RdlTagName.OBJ.ToString(), RdlObjectTypeName.RACE.ToString());

            if (races.Count > 0)
            {
                Game.Races.Clear();
                RdlTagCollection raceTags = new RdlTagCollection();
                foreach (var item in races)
                {
                    raceTags.Add(item);
                    Race race = new Race
                    {
                        Name        = item.Name,
                        Description = item.Description,
                    };
                    RdlProperty prop = tags.GetProperty(item.ID, "Attr_Strength");
                    if (prop != null)
                    {
                        race.Strength = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Dexterity");
                    if (prop != null)
                    {
                        race.Dexterity = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Stamina");
                    if (prop != null)
                    {
                        race.Stamina = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Beauty");
                    if (prop != null)
                    {
                        race.Beauty = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Intelligence");
                    if (prop != null)
                    {
                        race.Intelligence = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Perception");
                    if (prop != null)
                    {
                        race.Perception = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Endurance");
                    if (prop != null)
                    {
                        race.Endurance = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Affinity");
                    if (prop != null)
                    {
                        race.Affinity = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }

                    Game.Races.Add(item.Name, race);
                }
            }
        }