Пример #1
0
        public void RemoveMonster(MonsterNonAwake monsterAdd)
        {
            int i = 0;

            foreach (MonsterNonAwake monster in ListBestiary)
            {
                if (monsterAdd.CompareTo(monster) == 0)
                {
                    ListBestiary.RemoveAt(i);
                    return;
                }
                i++;
            }
        }
Пример #2
0
        /// <summary>
        /// Add a non awaken monster to the bestiary
        /// </summary>
        /// <param name="monsterAdd"></param>
        public bool AddMonster(MonsterNonAwake monsterAdd)
        {
            int i = 0;

            foreach (MonsterNonAwake monster in ListBestiary)
            {
                if (monsterAdd.CompareTo(monster) == 0)
                {
                    return(false);
                }
                if (monsterAdd.CompareTo(monster) <= 0)
                {
                    ListBestiary.Insert(i, monsterAdd);
                    return(true);
                }
                i++;
            }
            ListBestiary.Add(monsterAdd);
            return(true);
        }