Skip to content

Commit 3f9a60e

Browse files
authored
Merge pull request #69 from code-dot-org/hbergam/glomming-singular
Remove second paint glomming algorithm to simplify Neighborhood drawer
2 parents 318d54c + e5edf4b commit 3f9a60e

File tree

3 files changed

+9
-411
lines changed

3 files changed

+9
-411
lines changed

src/neighborhood.js

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Subtype from "./subtype";
22
import NeighborhoodCell from "./neighborhoodCell";
3-
import NeighborhoodSquareDrawer from "./neighborhoodSquareDrawer";
4-
import NeighborhoodCircleDrawer from "./neighborhoodCircleDrawer";
3+
import NeighborhoodDrawer from "./neighborhoodDrawer";
54
import { Direction } from "./tiles";
65

76
module.exports = class Neighborhood extends Subtype {
@@ -76,24 +75,14 @@ module.exports = class Neighborhood extends Subtype {
7675
/**
7776
* @override
7877
**/
79-
createDrawer(svg, drawer = "square") {
80-
if (drawer === "square") {
81-
this.drawer = new NeighborhoodSquareDrawer(
82-
this.maze_.map,
83-
this.skin_,
84-
svg,
85-
this.squareSize,
86-
this
87-
);
88-
} else {
89-
this.drawer = new NeighborhoodCircleDrawer(
90-
this.maze_.map,
91-
this.skin_,
92-
svg,
93-
this.squareSize,
94-
this
95-
);
96-
}
78+
createDrawer(svg) {
79+
this.drawer = new NeighborhoodDrawer(
80+
this.maze_.map,
81+
this.skin_,
82+
svg,
83+
this.squareSize,
84+
this
85+
);
9786
}
9887

9988
/**

0 commit comments

Comments
 (0)