Remove some more recursive duplication in the rmgen library (painting terrain based on height).
Description
Description
Details
Details
- Committed
elexis Sep 16 2017, 12:28 PM - Parents
- rP20188: Change comment for the MatchesClassList function so we can use it for other…
- Branches
- Unknown
- Tags
- Build Status
Buildable 3182 Build 5496: Post-Commit Build Jenkins
Event Timeline
/ps/trunk/binaries/data/mods/public/maps/random/rmgen/misc.js | ||
---|---|---|
337 | The mode documentation seemed somewhat useful, since now (at least just looking at that file) I have to read the code. Which leads me to wonder why we don't just make users provide minheight-1 or maxheight+1 if they want that. No clue how many users of this are or if that is something that would make things nicer/easier to understand though. |
/ps/trunk/binaries/data/mods/public/maps/random/rmgen/misc.js | ||
---|---|---|
337 | Comments should state something which isn't obvious from glancing at the code. |
/ps/trunk/binaries/data/mods/public/maps/random/rmgen/misc.js | ||
---|---|---|
337 | In fact the numbers should be global constants (similar to ELEVATION_MODIFY in painter.js) instead of repeating a random 3 or 1 magic numbers throughout the maps. The modifyTilesBasedOnHeight can be removed altogether and the functions can just become a createArea call after the HeightPlacer receives this mode as an argument, replacing these 140 lines with something like 10. |