Raymond Maarloeve
Loading...
Searching...
No Matches
DecorationSpawner Class Reference

Responsible for placing decorative elements (e.g. trees, rocks) on available tiles in the terrain. More...

Public Member Functions

 DecorationSpawner (Terrain terrain, int tileSize)
 Initializes a new instance of the DecorationSpawner class.
 
int SpawnDecorations (Tile[,] tiles, List< Tile > allTiles, List< BuildingSetup > decorations)
 Spawns decorative objects randomly on unoccupied tiles.
 

Detailed Description

Responsible for placing decorative elements (e.g. trees, rocks) on available tiles in the terrain.

Constructor & Destructor Documentation

◆ DecorationSpawner()

DecorationSpawner.DecorationSpawner ( Terrain  terrain,
int  tileSize 
)

Initializes a new instance of the DecorationSpawner class.

Parameters
terrainReference to the terrain object for height placement.
tileSizeSize of a single tile in world units.

Member Function Documentation

◆ SpawnDecorations()

int DecorationSpawner.SpawnDecorations ( Tile  tiles[,],
List< Tile allTiles,
List< BuildingSetup decorations 
)

Spawns decorative objects randomly on unoccupied tiles.

Parameters
tiles2D grid of map tiles.
allTilesFlat list of all tiles for random sampling.
decorationsList of decoration prefabs with weight configuration.
Returns
Total number of decorations placed.

The documentation for this class was generated from the following file: