Class PortrayalTimeFilter
Leaves out the drawing instructions that aren't valid at the time the map
shows (S-100 Part 9 timeValid; see
TimeValid).
public static class PortrayalTimeFilter
- Inheritance
-
PortrayalTimeFilter
- Inherited Members
Remarks
The filter runs on a display list that has already been portrayed, so a host can move the view time without running the portrayal rules again.
Methods
Apply(IReadOnlyList<DrawingInstruction>, PortrayalTime?)
The instructions of instructions drawn at
time, in order; all of them when
time is null.
public static IReadOnlyList<DrawingInstruction> Apply(IReadOnlyList<DrawingInstruction> instructions, PortrayalTime? time)
Parameters
instructionsIReadOnlyList<DrawingInstruction>The display list.
timePortrayalTimeThe time the map shows, or null for no filter.
Returns
- IReadOnlyList<DrawingInstruction>
The instructions drawn;
instructionsitself when none is left out.
Changes(IEnumerable<PortrayalTimeInterval>, PortrayalTime?, PortrayalTime?)
Whether moving the map from from to
to can change what a display list with
intervals draws: some interval holds at one and not
the other.
public static bool Changes(IEnumerable<PortrayalTimeInterval> intervals, PortrayalTime? from, PortrayalTime? to)
Parameters
intervalsIEnumerable<PortrayalTimeInterval>The display list's intervals (Intervals(IEnumerable<DrawingInstruction>)).
fromPortrayalTimeThe time drawn now.
toPortrayalTimeThe new time.
Returns
Intervals(IEnumerable<DrawingInstruction>)
The distinct time intervals of instructions, in first-seen order.
public static IReadOnlyList<PortrayalTimeInterval> Intervals(IEnumerable<DrawingInstruction> instructions)
Parameters
instructionsIEnumerable<DrawingInstruction>The display list.
Returns
- IReadOnlyList<PortrayalTimeInterval>
The intervals; empty when every instruction is always drawn.
IsDrawn(DrawingInstruction, PortrayalTime)
Whether instruction is drawn at time:
it has no time intervals, or time meets one of them.
public static bool IsDrawn(DrawingInstruction instruction, PortrayalTime time)
Parameters
instructionDrawingInstructionThe instruction.
timePortrayalTimeThe time the map shows.