yellowstonegames / SquidLib

Useful tools for roguelike, role-playing, strategy, and other grid-based games in Java. Feedback is welcome!
Other
454 stars 46 forks source link

SquidLayers clear(int x, int y) documentation is misleading regarding what it does #176

Closed SquidPony closed 7 years ago

SquidPony commented 7 years ago

` /**

Has a side effect of setting that backing character to null rather than a space. This means that while the tile is set to clear when this is called if the backing character set is accessed (to cache off in my case) and then used again later a solid block instead of a clear block is placed there.

I'm not sure if the correct fix is to just change the documentation to make that side effect clear or to change the way the method works to do what the doc says. Either way is probably fine.

tommyettinger commented 7 years ago

This is pretty much a bug, yeah. Since erase() fills with space, clear() should too. I have a commit ready that fixes this, though I need to ensure I can pull OK.