コード例 #1
0
        /**
         * <summary>
         * Finds adjacent and possibly free tiles to the one given
         * </summary>
         */
        private List <LayerTile> IsAdjacentTileFree(LayerTile tile, DStarLite dstar)
        {
            List <LayerTile> res = new List <LayerTile>();

            if (tile != null)
            {
                foreach (Point neighborPoint in fog.Adjacents(tile, dstar.adjPoints))
                {
                    LayerTile u = map.GetTileByMapCoordinates(neighborPoint.X, neighborPoint.Y);
                    if (dstar.CalculateDistance(u) != float.PositiveInfinity)
                    {
                        res.Add(u);
                    }
                }
            }
            return(res);
        }