Skip to content

ObjectRule

public sealed class ObjectRule

Namespace MapExpansions

Selects objects by name in one world, optionally limited to an area.

public string Id { get; set; }

Stable id inside the expansion, which a map layer uses to replace or remove the rule. Empty takes one made of side, names, area and effect.

public WorldSide Side { get; set; }

Type: WorldSide

public string Name { get; set; }

The object’s name starts with this (case-insensitive).

public string Parent { get; set; }

When set, some ancestor’s name starts with this.

public Bounds Area { get; set; }

When its size is not zero, the object’s bounds must intersect this box. Main-world coordinates for WorldSide.Main, expansion-local ones for WorldSide.Expansion.

public ObjectEffect Effect { get; set; }

Type: ObjectEffect

public float Bottom { get; set; }

For ObjectEffect.Skirt: the height the wall reaches down to, in the same coordinates as Area.

public float TopShift { get; set; }

For ObjectEffect.ColliderTop: metres the top face moves up, negative for down.

public List<Bounds> Openings { get; private set; }

For ObjectEffect.Hollow: doorways left open in the shell, in the same coordinates as Area.

public List<(float From, string Material)> Bands { get; private set; }

For ObjectEffect.Hollow: wall bands of the inside lining, each from a height above the floor in metres up to the next band or the ceiling, with the name of a loaded material.

public string CeilingMaterial { get; set; }

For ObjectEffect.Hollow: the name of a loaded material for the lining’s ceiling.

public string FloorMaterial { get; set; }

For ObjectEffect.Hollow: the name of a loaded material for the lining’s floor, laid 5 mm above the box’s bottom face over whatever floor the model draws there.

public List<Bounds> Windows { get; private set; }

For ObjectEffect.Hollow: boxes left open in the lining only, such as windows, in the same coordinates as Area.

public string FrameMaterial { get; set; }

For ObjectEffect.Hollow: the name of a loaded material for a frame around every hole in the lining’s walls, FrameWidth wide on the wall and as deep as the gap between lining and outer wall. Edges on the floor, the ceiling or a corner, and edges inside another hole, get none.

public float FrameWidth { get; set; }

For ObjectEffect.Hollow: width of FrameMaterial on the wall in metres.

public float LiningInset { get; set; }

For ObjectEffect.Hollow: metres between the outer walls and the lining’s walls. More than the default keeps sills and frames the outer model draws inward behind the lining.

public static ObjectRule In(
WorldSide side,
string name,
ObjectEffect effect,
string parent = null)

Types: WorldSide, ObjectEffect

public ObjectRule Within(Vector3 min, Vector3 max)
public ObjectRule DownTo(float height)

Sets Bottom.

public ObjectRule ShiftTop(float metres)

Sets TopShift.

public ObjectRule Opening(Vector3 min, Vector3 max)

Adds a box to Openings.

public ObjectRule Band(float from, string material)

Adds a wall band to Bands.

public ObjectRule Ceiling(string material)

Sets CeilingMaterial.

public ObjectRule Floor(string material)

Sets FloorMaterial.

public ObjectRule Frame(string material, float width = 0.06f)

Sets FrameMaterial and FrameWidth.

public ObjectRule Inset(float metres)

Sets LiningInset.

public ObjectRule Window(Vector3 min, Vector3 max)

Adds a box to Windows.

public override string ToString()