Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions src/neighborhood.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Subtype from "./subtype";
import NeighborhoodCell from "./neighborhoodCell";
import NeighborhoodDrawer from "./neighborhoodDrawer";
import NeighborhoodSquareDrawer from "./neighborhoodSquareDrawer";
import NeighborhoodCircleDrawer from "./neighborhoodCircleDrawer";
import { Direction } from "./tiles";

module.exports = class Neighborhood extends Subtype {
Expand Down Expand Up @@ -75,14 +76,24 @@ module.exports = class Neighborhood extends Subtype {
/**
* @override
**/
createDrawer(svg) {
this.drawer = new NeighborhoodDrawer(
this.maze_.map,
this.skin_,
svg,
this.squareSize,
this
);
createDrawer(svg, drawer = "square") {
if (drawer === "square") {
this.drawer = new NeighborhoodSquareDrawer(
this.maze_.map,
this.skin_,
svg,
this.squareSize,
this
);
} else {
this.drawer = new NeighborhoodCircleDrawer(
this.maze_.map,
this.skin_,
svg,
this.squareSize,
this
);
}
}

/**
Expand Down
File renamed without changes.
Loading