Conversation
gampleman
left a comment
There was a problem hiding this comment.
This is a bit of a walkthrough through this PR.
| }); | ||
| } | ||
|
|
||
| computeLoadableTiles() { |
There was a problem hiding this comment.
This function just wraps a call to one other function, would it not be better to just call it directly?
There was a problem hiding this comment.
This get's overridden in one of the child classes. I will add a comment about that.
marksmall
left a comment
There was a problem hiding this comment.
Couple of comments, more points to ponder. There is a lot of maths with numbers passed in (I made a comment about this). I find it difficult to understand what they mean so making them constants might help there, I'll leave that up to you as it could mean a lot of refactoring.
| if (br.x > 1 && br.y > 1) add(t.neighbor(1, 1)); | ||
|
|
||
| if (tl.y < 0) add(t.neighbor(0, -1)); | ||
| if (br.y > 1) add(t.neighbor(0, 1)); |
There was a problem hiding this comment.
Might be better making the values checked against and those passed to neighbour, constants, would give these if statements more context. Basically I'm not sure in this situation what -1, 0, 1 represent.
There was a problem hiding this comment.
Their offsets of the tile. So given tile z=3, x=2, y=1:
tile.neighbor(0, 0) == tile == 3/2/1tile.neighbor(1, 0) == 3/3/1tile.neighbor(0, -1) == 3/2/0
and so on.
There was a problem hiding this comment.
A comment to that effect would be good then, if others have to support this, its likely to only be every few months anyone will look at the code and this isn't info I at least will remember or clean from the code.
src/tileID.js
Outdated
| return this.parent() | ||
| .children() | ||
| .filter(t => !this.isEqual(t)); | ||
| } |
There was a problem hiding this comment.
Could use a tertiary if here to make it more terse.
Implements tiling of all layers. Closes #3.