Skip to content

LineCell

namespace Griff.Scenes;
public struct LineCell

One cell of a line laid on a grid (see LineTool and LineDrag): its column and row (counted as a tilemap’s are, row 0 at the top), the way the line leaves it and the way it came in (x right, y up, as a grid mover steps and a Conveyor carries), and whether it can go there.

public ValueTuple<int, int> Cell { get; }

Its column and row.

public bool Fits { get; init; }
public ValueTuple<int, int> In { get; }

The way the line comes into it: the same as Way but at a corner. The first cell’s is its own way.

public int InX { get; init; }
public int InY { get; init; }
public bool IsCorner { get; }

True where the line turns: it comes in one way and leaves another.

public LineJoin Join { get; init; }

How it joins a line already there (see Join): none for a line laid on its own.

public bool OnOtherLine { get; }

True for a cell of a line already there that this one merges into or splits off: it isn’t laid with the line (a split’s cell becomes a splitter, keeping its way).

public ValueTuple<int, int> Way { get; }

The way the line leaves it: (1, 0) right, (0, 1) up, (-1, 0) left, (0, -1) down.

public int WayX { get; init; }
public int WayY { get; init; }
public int X { get; init; }
public int Y { get; init; }
public void Deconstruct(out int X, out int Y, out int WayX, out int WayY, out int InX, out int InY, out bool Fits)
public override bool Equals(object obj)
public bool Equals(LineCell other)
public override int GetHashCode()
public ConveyorCell ToConveyor(ConveyorCellKind kind = ConveyorCellKind.Belt)

The cell as a Conveyor’s, carrying the way the line runs.

public override string ToString()