Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: swap out leaky yggdrasil custom strategy for an internal abstraction #256

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

sighphyre
Copy link
Member

Adds an adaptor for Yggdrasil -> Legacy strategies so we don't have to leak out Yggdrasil abstractions. The barebones interface doesn't work because the method signature requires an Yggdrasil type - the Context.

Not tested automatically because it's all just plumbing but most of the existing tests already cover the Unleash constructor and manually tested through the example project

@sighphyre sighphyre changed the title chore: add owned interface for ygg strategies chore: swap out leaky yggdrasil custom strategy for an internal abstraction Nov 5, 2024
{
if (settings.FileSystem == null)
{
settings.FileSystem = new FileSystem(settings.Encoding);
}

engine = new YggdrasilEngine(strategies);
List<Yggdrasil.IStrategy> yggdrasilStrategies = strategies?.Select(s => new CustomStrategyAdapter(s)).Cast<Yggdrasil.IStrategy>().ToList();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the s as IStrategy didn't work here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, never mind.

The barebones interface doesn't work because the method signature requires an Yggdrasil type - the Context.

Copy link
Member Author

@sighphyre sighphyre Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean? Does that add anything over the cast?

Edit: Nevermind xD, responded before I saw the update

Copy link
Collaborator

@daveleek daveleek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sighphyre sighphyre merged commit 3ec6702 into main Nov 5, 2024
8 checks passed
@sighphyre sighphyre deleted the chore/add-owned-interface-for-ygg-strategies branch November 5, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants