LCOV - code coverage report
Current view: top level - maps/random/rmgen/painter - RandomElevationPainter.js (source / functions) Hit Total Coverage
Test: lcov.info Lines: 8 8 100.0 %
Date: 2023-04-02 12:52:40 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /**
       2             :  * Sets a random elevation of the given heightrange in the given Area.
       3             :  */
       4             : function RandomElevationPainter(minHeight, maxHeight)
       5             : {
       6           1 :         this.minHeight = minHeight;
       7           1 :         this.maxHeight = maxHeight;
       8             : }
       9             : 
      10           6 : RandomElevationPainter.prototype.paint = function(area)
      11             : {
      12           1 :         for (let point of area.getPoints())
      13           9 :                 for (let vertex of g_TileVertices)
      14             :                 {
      15          36 :                         let position = Vector2D.add(point, vertex);
      16          36 :                         if (g_Map.validHeight(position))
      17          36 :                                 g_Map.setHeight(position, randFloat(this.minHeight, this.maxHeight));
      18             :                 }
      19             : };

Generated by: LCOV version 1.14