This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

source: ps/trunk/binaries/data/mods/public/maps/random/rmgen/painter/ElevationPainter.js

Last change on this file was 28036, checked in by marder, 11 months ago

rmgen: var -> let -> const

One should always use the variable declaration with the least possible scope.
This patch cleans up many (but not all) of the var in rmgen and replaces them with let or const.
The same is done for let -> const.

comments by: @sera @Stan

Differential revision: https://code.wildfiregames.com/D5214

  • Property svn:eol-style set to native
File size: 396 bytes
Line 
1/**
2 * Sets the given height in the given Area.
3 */
4function ElevationPainter(elevation)
5{
6 this.elevation = elevation;
7}
8
9ElevationPainter.prototype.paint = function(area)
10{
11 for (const point of area.getPoints())
12 for (const vertex of g_TileVertices)
13 {
14 const position = Vector2D.add(point, vertex);
15 if (g_Map.validHeight(position))
16 g_Map.setHeight(position, this.elevation);
17 }
18};
Note: See TracBrowser for help on using the repository browser.