Esempio n. 1
0
 public void registerMonster(FarmMonster monster)
 {
     if (!currentMonsters.Contains(monster))
     {
         currentMonsters.Add(monster);
     }
 }
Esempio n. 2
0
        internal void cleanUpMonsters()
        {
            if (currentMonsters == null)
            {
                return;
            }

            for (int i = currentMonsters.Count - 1; i >= 0; --i)
            {
                FarmMonster monster = currentMonsters[i];
                if (monster.Health <= 0 || (monster.currentLocation != null &&
                                            !monster.currentLocation.characters.Contains(monster)))
                {
                    monster.processDeath();
                    currentMonsters.RemoveAt(i);
                }
            }
        }