Exemplo n.º 1
0
        public void FillCurrentMonstersFromRemainingMonsters()
        {
            int monstersToAdd = GetNumberOfMissingCurrentMonsters();

            for (int i = 0; i < monstersToAdd; ++i)
            {
                if (RemainingMonsters.Count > 0)
                {
                    IGameMonster monsterToAdd = RemainingMonsters[0];
                    CurrentMonsters.Add(monsterToAdd);
                    RemainingMonsters.RemoveAt(0);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Checks whether the specified monster exists in the current cell.
 /// </summary>
 /// <param name="name">The name of the monster whose existence should be checked.</param>
 /// <returns>Whether the specified monster exists and is alive in the current cell.</returns>
 public bool Exists(string name) => CurrentMonsters.Find(m => m.Name.Equals(name, StringComparison.OrdinalIgnoreCase) && m.Alive) != null;
Exemplo n.º 3
0
 public bool TryGetMonster(string name, out Monster monster)
 {
     monster = CurrentMonsters.Find(m => name == "*" || m.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
     return(monster != null);
 }