|
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 | */
|
|---|
| 4 | function ElevationPainter(elevation)
|
|---|
| 5 | {
|
|---|
| 6 | this.elevation = elevation;
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | ElevationPainter.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.