public bool IsVisible(MapPos mappos, int weight, object cRef = null)
        {
            int mapSize = m_map.GetMapSizeWith(weight);

            if (mappos.Row < 0 || mappos.Col < 0 || mappos.Row >= mapSize || mappos.Col >= mapSize)
            {
                return(false);
            }

            if (cRef != null)
            {
                CameraRef reference = (CameraRef)cRef;
                return(reference.Camera.IsVisible(mappos, weight));
            }

            return(m_mapCameras.Any(cam => cam.IsVisible(mappos, weight)));
        }
示例#2
0
 public PathFinder2(MapRoot map)
 {
     m_idToActiveTask = new Dictionary <long, PathFinderTask>();
     m_rand           = new System.Random(Guid.NewGuid().GetHashCode());
     m_matrixPools    = new PathMatrixPool[3];
     for (int i = 0; i < m_matrixPools.Length; ++i)
     {
         m_matrixPools[i] = new PathMatrixPool(100, map.GetMapSizeWith(GameConstants.MinVoxelActorWeight + i));
     }
 }