#pragma once
#include "matrix.hpp"
#include "map.hpp"

namespace maze {


  struct Builder {
    Matrix& $walls;
    std::vector<Room>& $rooms;
    std::vector<Point>& $dead_ends;

    Builder(Map& map) :
      $walls(map.$walls), $rooms(map.$rooms), $dead_ends(map.$dead_ends)
    {
      init();
    }

    void hunt_and_kill(Point on={1,1});

    void init();
    void randomize_rooms();
    void inner_donut(float outer_rad, float inner_rad);
    void inner_box(size_t outer_size, size_t inner_size);
    void divide(Point start, Point end);
    void remove_dead_ends();
    void dump(const std::string& msg);
  };
}
