BattleNet.ClientlessBot.GetAliveNpc C# (CSharp) Method

GetAliveNpc() public method

public GetAliveNpc ( String name, double range, NpcEntity &output ) : bool
name String
range double
output NpcEntity
return bool
        public bool GetAliveNpc(String name, double range, out NpcEntity output)
        {
            var n = (from npc in BotGameData.Npcs
                     where npc.Value.Name == name
                     && npc.Value.Life > 0
                     && (range == 0 || range > Me.Location.Distance(npc.Value.Location))
                     select npc).FirstOrDefault();
            if (n.Value == null)
            {
                output = default(NpcEntity);
                return false;
            }
            output = n.Value;
            return true;
        }