Class RegionContext
- Namespace
- WorldgenLib
- Assembly
- WorldgenLib.VintageStory.dll
Per-region context passed to GenMaps hooks at steps 1–9 and RegionFinalize. Contains the map region, noise sizes, and mutable map data.
public sealed class RegionContext
- Inheritance
-
RegionContext
- Inherited Members
Constructors
RegionContext(int, int, IMapRegion, int, int, int, int, int, int, int, int, Action<ForceLandform>?, Action<ForceClimate>?, Action<int, int>?, ICoreServerAPI?, Func<MapGeneratorStep, MapLayerBase>?)
public RegionContext(int regionX, int regionZ, IMapRegion mapRegion, int noiseSizeGeoProv, int noiseSizeClimate, int noiseSizeForest, int noiseSizeUpheavel, int noiseSizeOcean, int noiseSizeBeach, int noiseSizeShrubs, int noiseSizeLandform, Action<ForceLandform>? forceLandform = null, Action<ForceClimate>? forceClimate = null, Action<int, int>? requireLand = null, ICoreServerAPI? serverApi = null, Func<MapGeneratorStep, MapLayerBase>? getMapGenerator = null)
Parameters
regionXintregionZintmapRegionIMapRegionnoiseSizeGeoProvintnoiseSizeClimateintnoiseSizeForestintnoiseSizeUpheavelintnoiseSizeOceanintnoiseSizeBeachintnoiseSizeShrubsintnoiseSizeLandformintforceLandformAction<ForceLandform>forceClimateAction<ForceClimate>requireLandAction<int, int>serverApiICoreServerAPIgetMapGeneratorFunc<MapGeneratorStep, MapLayerBase>
Properties
ChunkGenParams
Parameters supplied by the worldgen request, when any.
public ITreeAttribute? ChunkGenParams { get; }
Property Value
- ITreeAttribute
CurrentMap
Map produced by the current step. A hook may replace this reference; the host writes it back to the corresponding region property after the chain completes.
public IntDataMap2D? CurrentMap { get; set; }
Property Value
- IntDataMap2D
MapRegion
public IMapRegion MapRegion { get; }
Property Value
- IMapRegion
NoiseSizeBeach
public int NoiseSizeBeach { get; }
Property Value
NoiseSizeClimate
public int NoiseSizeClimate { get; }
Property Value
NoiseSizeForest
public int NoiseSizeForest { get; }
Property Value
NoiseSizeGeoProv
public int NoiseSizeGeoProv { get; }
Property Value
NoiseSizeLandform
public int NoiseSizeLandform { get; }
Property Value
NoiseSizeOcean
public int NoiseSizeOcean { get; }
Property Value
NoiseSizeShrubs
public int NoiseSizeShrubs { get; }
Property Value
NoiseSizeUpheavel
public int NoiseSizeUpheavel { get; }
Property Value
RegionX
public int RegionX { get; }
Property Value
RegionZ
public int RegionZ { get; }
Property Value
ServerApi
public ICoreServerAPI? ServerApi { get; }
Property Value
- ICoreServerAPI
Methods
ForceClimateAt(ForceClimate)
Queue a forced climate value.
public void ForceClimateAt(ForceClimate climate)
Parameters
climateForceClimate
ForceLandformAt(ForceLandform)
Queue a forced landform.
public void ForceLandformAt(ForceLandform landform)
Parameters
landformForceLandform
GetMap(RegionMapSlot)
Get a persistent custom map registered for this region.
public IntDataMap2D GetMap(RegionMapSlot slot)
Parameters
slotRegionMapSlot
Returns
- IntDataMap2D
GetMapGenerator(MapGeneratorStep)
Gets the generator currently assembled for a map stage. This is available to a full-region adapter after worldgen initialization.
public MapLayerBase GetMapGenerator(MapGeneratorStep step)
Parameters
stepMapGeneratorStep
Returns
- MapLayerBase
RequireLandAt(int, int)
Require land at an ocean map coordinate.
public void RequireLandAt(int x, int z)