public Entity GetEntityWithName(NPCName name) { if (!namedEntities.ContainsKey(name.ToString())) { return(null); } return(namedEntities[name.ToString()]); }
public static Entity GetEntityWithName(List <Entity> entities, NPCName name) { return(entities.Find(entity => entity.HasState <NameState>() && entity.GetState <NameState>().Name == name.ToString())); }