Ejemplo n.º 1
0
        public MapBuilder Generate(Algorithms algorithm, int width, int height)
        {
            var model = new MapBuilderGeneratorModel
            {
                Width     = width,
                Height    = height,
                Algorithm = algorithm
            };

            return(Generate(model));
        }
Ejemplo n.º 2
0
        public MapBuilder Generate(MapBuilderGeneratorModel model)
        {
            switch (model.Algorithm)
            {
            case Algorithms.DepthFirst:
                return(new DfMapGenerator(model.Width, model.Height, model.BlockedPoints).Generate());

            default:
                return(new MfpMapGenerator().Generate(model.Width, model.Height, model.Algorithm.ToMfpAlgorithm()));
            }

            throw new Exception($"No generate implementation for algorithm {model.Algorithm}");
        }