Пример #1
0
        public static Puzzle Normalise(Puzzle puzzle)
        {
            var allFloor  = puzzle.ToMap(puzzle.Definition.AllFloors);
            var trueFloor = FloodFill.Fill(allFloor.Invert(), puzzle.Player.Position);
            var wall      = trueFloor.Invert();

            var norm = puzzle.Clone();

            foreach (var w in wall.TruePositions())
            {
                norm[w] = puzzle.Definition.Wall;
            }

            return(norm);
        }
Пример #2
0
 public static StateMaps Create(Puzzle puzzle) =>
 new StateMaps(puzzle.ToMap(puzzle.Definition.AllCrates),
               FloodFill.Fill(puzzle.ToMap(puzzle.Definition.Wall), puzzle.Player.Position));