8000 Add AddBehavior<TBehavior> overload by kzu · Pull Request #281 · devlooped/stunts · GitHub
[go: up one dir, main page]

Skip to content

Add AddBehavior<TBehavior> overload - #281

Merged
kzu merged 1 commit into
mainfrom
add-behavior-generic
Oct 7, 2026
Merged

kzu merged 1 commit into
mainfrom
add-behavior-generic

Conversation

@kzu
@kzu kzu commented Oct 7, 2026
Copy link
Copy Markdown
Member

Adds IStunt.AddBehavior<TBehavior>() where TBehavior : IStuntBehavior, new(), a shorthand for AddBehavior(() => new TBehavior()).

Semantics follow the #277 factory overloads:

  • On a stunt that is not constructed yet (builder/reference), registers a factory so each pipeline seeding creates a new TBehavior instance.
  • On an already-constructed stunt, creates the instance immediately and adds it to the live pipeline.

Note: C# does not support partial explicit type arguments, so the overload takes the behavior type as its single type parameter and the receiver as IStunt (returning IStunt for chaining). Includes scenario tests for per-build instances and live-pipeline addition.

@kzu kzu added the enhancement New feature or request label Oct 7, 2026
@kzu
kzu enabled auto-merge (rebase) October 7, 2026 22:04
@kzu
kzu merged commit 5d9d0c4 into main Oct 7, 2026
@kzu
kzu deleted the add-behavior-generic branch October 7, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0