PaneFlow class
Namespace: Arlecchino.Rendering · Assembly: Arlecchino.Core
A flow cursor inside one region: it writes the next line and remembers where the one after it goes, clipped to the region.
var flow = region.Flow();
flow.AppendLine("PLAYERS", Theme.TableHeader);
foreach (var player in players)
{
flow.AppendLine(player.Name, Theme.Default);
}
public sealed class PaneFlow
Properties
| Member | Summary |
|---|---|
FreeLines | How many rows are left. Zero once the region is full. |
IsFull | Whether there is any room left to write in. |
Region | The region being written into. |
Row | The row the next line goes on, counted from the top of the region. |
Methods
| Member | Summary |
|---|---|
AppendLine(string, IArlecchinoColor, Align) | Writes one line at the cursor and moves it down. Once the region is full the call does nothing, so a loop over more rows than fit needs no bound of its own. |
FillLine(IArlecchinoColor) | Draws a rule of - across the region and moves the cursor down. |
Rest() | The rows the cursor has not reached yet, as a region of their own — for handing what is left of a pane to a widget once the lines above it are written. |
Rewind() | Puts the cursor back on the first row of the region. |
Skip(int) | Leaves several rows blank. |
SkipLine() | Leaves the next row blank. |
Properties in detail
FreeLines
public int FreeLines { get; }
How many rows are left. Zero once the region is full.
Type int
IsFull
public bool IsFull { get; }
Whether there is any room left to write in.
Type bool
Region
public SurfaceRegion Region { get; }
The region being written into.
Type SurfaceRegion
Row
public int Row { get; }
The row the next line goes on, counted from the top of the region.
Type int
Methods in detail
AppendLine(string, IArlecchinoColor, Align)
public void AppendLine(string line, IArlecchinoColor? style = null, Align align = Left);
Writes one line at the cursor and moves it down. Once the region is full the call does nothing, so a loop over more rows than fit needs no bound of its own.
Parameters
| Name | Type | Description |
|---|---|---|
line | string | Text to write. |
style | IArlecchinoColor | Style for the line; the default role when omitted. |
align | Align | Horizontal alignment inside the region. |
FillLine(IArlecchinoColor)
public void FillLine(IArlecchinoColor? style = null);
Draws a rule of - across the region and moves the cursor down.
Parameters
| Name | Type | Description |
|---|---|---|
style | IArlecchinoColor | Style for the rule; the default role when omitted. |
Rest()
public SurfaceRegion Rest();
The rows the cursor has not reached yet, as a region of their own — for handing what is left of a pane to a widget once the lines above it are written.
Returns SurfaceRegion — The region below the cursor, empty when there is nothing left.
Rewind()
public void Rewind();
Puts the cursor back on the first row of the region.
Skip(int)
public void Skip(int rows);
Leaves several rows blank.
Parameters
| Name | Type | Description |
|---|---|---|
rows | int | How many to leave. |
SkipLine()
public void SkipLine();
Leaves the next row blank.