Class ScenePhase
- Namespace
- SkyrimForge
- Assembly
- SkyrimForge.dll
A phase of a QuestScene, whose actions start together.
public sealed class ScenePhase
- Inheritance
-
ScenePhase
- Inherited Members
Remarks
The next phase starts once each action ending in this one has ended.
Constructors
ScenePhase(params IEnumerable<SceneAction>)
Creates a phase.
public ScenePhase(params IEnumerable<SceneAction> actions)
Parameters
actionsIEnumerable<SceneAction>The actions. A phase with none waits until EndsWhen returns true.
Exceptions
- ArgumentNullException
actionsisnull.
Properties
Actions
The actions. A phase created with none that has an EndsWhen has one SceneTimer.
public IReadOnlyList<SceneAction> Actions { get; }
Property Value
Condition
Returns whether the phase plays. Null means the phase always plays.
public Func<QuestScene, bool>? Condition { get; init; }
Property Value
Remarks
The quest raises no phase event and sets no stage for a skipped phase. It runs on the game's thread on each frame the scene plays, and the game reads its last result one frame later. An exception from it is logged and counts as false.
EndsWhen
Returns whether the phase is complete. Null means the phase's actions end it.
public Func<QuestScene, bool>? EndsWhen { get; init; }
Property Value
Remarks
The phase ends once it returns true, even while its actions still run, and not before, even after they have ended. TimeLimit bounds the wait. It runs on the game's thread on each frame the scene plays, and the game reads its last result one frame later. An exception from it is logged and counts as false.
StageSetWhenBegun
The stage the quest sets when the phase begins. The quest declares the stage. A null value sets no stage.
public QuestStage? StageSetWhenBegun { get; init; }
Property Value
TimeLimit
The longest unpaused time the phase lasts. Null means no limit.
public TimeSpan? TimeLimit { get; init; }
Property Value
Remarks
The phase ends at the limit even while its actions still run or EndsWhen returns false. The time counts from the frame OnPhaseBegin is raised, and from zero again for a phase played again after a load.
Exceptions
- ArgumentOutOfRangeException
The value is zero or negative.
Operators
implicit operator ScenePhase(SceneAction)
Converts action to a phase of that action alone.
public static implicit operator ScenePhase(SceneAction action)
Parameters
actionSceneAction