Exemple #1
0
        public static bool IsPerfectMaze(InnerMap map)
        {
            var copiedInnerMap = map.Clone();

            FloodFill(copiedInnerMap);

            //Make uneven because a maze actually is this size and not an even number
            var unevenHeight = UnevenHelper.MakeUneven(copiedInnerMap.Height);
            var unevenWidth  = UnevenHelper.MakeUneven(copiedInnerMap.Width);

            for (int y = 0; y < unevenHeight; y++)
            {
                for (int x = 0; x < unevenWidth; x++)
                {
                    if (copiedInnerMap[x, y] == false)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }