Esempio n. 1
0
        public MonsterTheme Copy()
        {
            MonsterTheme monsterTheme = new MonsterTheme()
            {
                ID   = this.fID,
                Name = this.fName
            };

            foreach (Pair <string, int> fSkillBonuse in this.fSkillBonuses)
            {
                monsterTheme.SkillBonuses.Add(new Pair <string, int>(fSkillBonuse.First, fSkillBonuse.Second));
            }
            foreach (ThemePowerData fPower in this.fPowers)
            {
                monsterTheme.Powers.Add(fPower.Copy());
            }
            return(monsterTheme);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a copy of the monster theme.
        /// </summary>
        /// <returns>Returns the copy.</returns>
        public MonsterTheme Copy()
        {
            MonsterTheme mt = new MonsterTheme();

            mt.ID   = fID;
            mt.Name = fName;

            foreach (Pair <string, int> sb in fSkillBonuses)
            {
                mt.SkillBonuses.Add(new Pair <string, int>(sb.First, sb.Second));
            }

            foreach (ThemePowerData tpd in fPowers)
            {
                mt.Powers.Add(tpd.Copy());
            }

            return(mt);
        }
Esempio n. 3
0
        public MonsterTheme FindTheme(Guid theme_id)
        {
            MonsterTheme monsterTheme;

            List <MonsterTheme> .Enumerator enumerator = this.fThemes.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    MonsterTheme current = enumerator.Current;
                    if (current == null || !(current.ID == theme_id))
                    {
                        continue;
                    }
                    monsterTheme = current;
                    return(monsterTheme);
                }
                return(null);
            }
            finally
            {
                ((IDisposable)enumerator).Dispose();
            }
        }