Skip to main content

MapGeneratorPartInstance<T>

An abstract class in Root.Township, Alta.Caves.PluginParts.

Runtime instance of a MapGeneratorPart for one cave generator plugin run. It works out the target plugin layer and a seeded identifier, and subclasses change map chunk layers.

Constructors​

MemberWhat it is
MapGeneratorPartInstance(PluginInstance plugin, T part)Creates a MapGeneratorPartInstance from plugin and part.

Properties​

MemberWhat it is
T Part { get; private set; }The part asset this instance was made from.
int PartIdentifier { get; private set; }Random identifier from the generator's hash function, seeded by the plugin's random identifier and the part's identifier.
Plugin Plugin { get; private set; }The plugin asset of the owning plugin instance.
PluginInstance PluginInstance { get; private set; }The plugin instance that created this part instance.
Plugin Target { get; private set; }Plugin whose layer this part changes: the part's OverrideTarget, or the owning plugin if none.

Methods​

MemberWhat it is
void Modify(MapChunk chunk)Changes the target layer of a map chunk. The chunk overload finds the layer and passes on the chunk offsets.
abstract void Modify(MapChunkLayer target, int offX, int offY)Changes the target layer of a map chunk. The chunk overload finds the layer and passes on the chunk offsets.