Skip to main content

WoodcutTree.MapNode

A class in Root.Township, Alta.Woodcutting.

One segment in a WoodcutTree's layout: its model, the connection it hangs from, its children and attachments. Mass and size changes add up into the parent nodes.

Constructors​

MemberWhat it is
MapNode()Creates a WoodcutTree.MapNode with default values.

Fields​

2 private and internal fields
MemberWhat it is
private float massBacking field for Mass. Changes are added to the parent node's mass too.
private int totalSizeBacking field for TotalSize. Changes are added to the parent node's total size too.

Properties​

MemberWhat it is
List<TreeAttachment> Attachments { get; }Attachments on this segment.
Dictionary<WoodcutConnection, WoodcutTree.MapNode> Children { get; }Child nodes by the connection they hang from.
bool HasFirstRenderer { get; private set; }False if the first LOD renderer was skipped because the model's colour is off.
float Mass { get; set; }Mass of this segment and everything above it. Changes propagate to the parent.
WoodcutTreeModel Model { get; set; }The segment's model.
WoodcutConnection Parent { get; set; }Connection this segment hangs from. Null for the root.
MeshRenderer[] Renderers { get; private set; }LOD renderers made by GenerateRenderers.
int Rotation { get; set; }Rotation step on the parent connection.
int TotalSize { get; set; }Segment count of this node and everything above it. Changes propagate to the parent.
WoodcutTree Tree { get; set; }The tree this node belongs to.

Methods​

MemberWhat it is
void AddAttachment(TreeAttachment attachment)Attaches a TreeAttachment (such as a branch item) to this segment and saves it as a child.
void GenerateRenderers()Creates hidden LOD mesh renderers for the segment, once.
void RemoveAttachment(TreeAttachment attachment)Detaches an attachment from this segment.
void SpawnAttachment(PresetTree.Step.Attachment stepAttachment)Spawns a preset attachment and attaches it at its saved position, rotation and scale.

Used in​

Members of other types that take, return or hold a MapNode: