Skip to content

Commit

Permalink
feat: expose qualified name variant of BeforePass
Browse files Browse the repository at this point in the history
Closes: #92
  • Loading branch information
bdunderscore committed Jan 6, 2024
1 parent 7842eac commit 924142c
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Editor/API/Fluent/Sequence/Sequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ internal DeclaringPass(SolverPass pass, SolverContext solverContext, BuildPhase

/// <summary>
/// Declares that the pass you just declared must run before a particular other plugin.
///
/// It's recommended to avoid using this to refer to passes in other plugins, as the internal class names
/// of those plugins may not be a stable API.
/// </summary>
/// <param name="QualifiedName">The qualified name of the other plugin</param>
/// <returns>This DeclaringPass context</returns>
Expand Down Expand Up @@ -82,7 +85,17 @@ public DeclaringPass BeforePlugin<T>(T plugin, [CallerFilePath] string sourceFil
}


private DeclaringPass BeforePass(string qualifiedName, string sourceFile = "", int sourceLine = 0)
/// <summary>
/// Declares that the pass you just declared must run after a particular other pass.
///
/// It's recommended to avoid using this to refer to passes in other plugins, as the internal class names
/// of those plugins may not be a stable API.
/// </summary>
/// <param name="qualifiedName"></param>
/// <param name="sourceFile"></param>
/// <param name="sourceLine"></param>
/// <returns></returns>
public DeclaringPass BeforePass(string qualifiedName, string sourceFile = "", int sourceLine = 0)
{
_solverContext.Constraints.Add(new Constraint()
{
Expand Down Expand Up @@ -124,7 +137,8 @@ public sealed partial class Sequence

private int inlinePassIndex = 0;

internal Sequence(BuildPhase phase, SolverContext solverContext, IPluginInternal plugin, string sequenceBaseName)
internal Sequence(BuildPhase phase, SolverContext solverContext, IPluginInternal plugin,
string sequenceBaseName)
{
_phase = phase;
_solverContext = solverContext;
Expand Down Expand Up @@ -167,7 +181,8 @@ internal Sequence(BuildPhase phase, SolverContext solverContext, IPluginInternal
private SolverPass CreateSequencingPass(string displayName, InlinePass callback, string sourceFile,
int sourceLine)
{
var anonPass = new AnonymousPass(_sequenceBaseName + "/" + displayName + "#" + inlinePassIndex++, displayName,
var anonPass = new AnonymousPass(_sequenceBaseName + "/" + displayName + "#" + inlinePassIndex++,
displayName,
callback);
var pass = new SolverPass(_plugin, anonPass, _phase, _compatibleExtensions, _requiredExtensions);
anonPass.IsPhantom = true;
Expand Down

0 comments on commit 924142c

Please sign in to comment.