示例#1
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;
示例#2
0
 public bool TryGetMonster(string name, out Monster monster)
 {
     monster = CurrentMonsters.Find(m => name == "*" || m.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
     return(monster != null);
 }