Class ShapeBuilder
- Namespace
- GrindFest.Editor.DungeonBuilding.Fluent
- Assembly
- GrindFest.dll
Custom cell-list builder for non-rectangular rooms (cruciform, L-shape, hex approximations, etc.). Used inside Shape(Action<ShapeBuilder>).
Composable additive grammar:
.Shape(c => c
.Rect(0, 4, 2, 2) // horizontal arm of cross
.Cells((2,0), (2,1), (2,3), (2,4))) // vertical arm
.Shape(c => c
.Rect(0, 6, 0, 2) // base 7x3
.RemoveCells((3, 1))) // dig out center for pit</code></pre>
public sealed class ShapeBuilder
- Inheritance
-
objectShapeBuilder
Methods
- Cells(params (int x, int z)[])
Add explicit cells.
- Cross(int, int, int)
Convenience: cruciform centered at (cx, cz) with given arm length.
- Rect(int, int, int, int)
Add a rectangular block of cells (xMin..xMax, zMin..zMax inclusive).
- RemoveCells(params (int x, int z)[])
Remove cells from the current shape.