Exemplo n.º 1
0
        public bool TryGetPointsOfInterest(WowMapId mapId, PoiType poiType, Vector3 position, float maxRadius, out IEnumerable <Vector3> nodes)
        {
            KeyValuePair <WowMapId, PoiType> KeyValuePair = new(mapId, poiType);

            if (PointsOfInterest.ContainsKey(mapId) &&
                PointsOfInterest[mapId].ContainsKey(poiType))
            {
                nodes = PointsOfInterest[mapId][poiType].Where(e => e.GetDistance(position) < maxRadius);
                return(nodes.Any());
            }

            nodes = null;
            return(false);
        }
Exemplo n.º 2
0
 public void CachePoi(WowMapId mapId, PoiType poiType, Vector3 position)
 {
     if (!PointsOfInterest.ContainsKey(mapId))
     {
         PointsOfInterest.TryAdd(mapId, new Dictionary <PoiType, List <Vector3> >()
         {
             { poiType, new List <Vector3>()
               {
                   position
               } }
         });
     }
     else if (!PointsOfInterest[mapId].ContainsKey(poiType))
     {
         PointsOfInterest[mapId].Add(poiType, new List <Vector3>()
         {
             position
         });
     }
     else if (!PointsOfInterest[mapId][poiType].Any(e => e == position))
     {
         PointsOfInterest[mapId][poiType].Add(position);
     }
 }