예제 #1
0
        /// <summary>
        /// Determines if a tile is considered to be blocking the path.
        /// </summary>
        /// <param name="tile">The tile to evaluate.</param>
        /// <returns>True if the tile is considered path blocking, false otherwise.</returns>
        public static bool IsPathBlocking(this ITile tile)
        {
            var blocking = tile.BlocksPass;

            if (blocking)
            {
                return(true);
            }

            var(fixedItems, items) = tile.GetItemsToDescribeByPriority(-1);

            blocking |= tile.Creatures.Any() || fixedItems.Any(i => i.IsPathBlocking()) || items.Any(i => i.IsPathBlocking());

            return(blocking);
        }